Adding Top Level Function to use calculateDelta in factorial designs (WIP)#8
Adding Top Level Function to use calculateDelta in factorial designs (WIP)#8lboel wants to merge 1 commit intoigmmgi:masterfrom
Conversation
|
@igmmgi Ruben uses this approach for his experiment designs. So I build a function based on his approach. |
|
Would something like this work using group_modify from dplyr? This keeps the same tibble columns and just adds in the additionalFactor. library(dplyr)
dat <- createDF(nSubjects = 1, nTrl = 10000, design = list("Comp" = c("comp", "incomp")))
dat <- addDataDF(dat,
RT = list("Comp_comp" = c(500, 80, 100),
"Comp_incomp" = c(600, 80, 140)))
dat$additionalFactor <- sample(c("Test","Experiment"),nrow(dat),replace = T)
delta_group <- dat %>%
group_by(additionalFactor) %>%
group_modify(~ calculateDelta(.,
nDelta = 19,
tDelta = 1,
columns = c("Subject", "Comp", "RT"),
compCoding = c("comp", "incomp"),
quantileType = 5)) |
|
Ians solution works well for me. Just adding %>% gives the tibble I want for ggplot. Thanks a lot, @igmmgi, this will save me a lot of time and nerves. I was wondering whether the solution might be good to add to the documentation/tutorial, as users without strong programming background might not come up with such straightforward solution. This is just an intuition and up to the developers of course. |
A small proposal for a top level function to use calculateDelta in a factorial design.
Would output something like this:

This function was developed based on an idea by https://github.com/rubenellinghaus.
At the moment this is only a draft and the main contributors should decide whether I should proceed here and this is a good addition to the package.
Best,
Luke