mygenerate <- function(condition, fixed_objects = NULL){
#require packages/define functions if needed, or better yet index with the :: operator
N1 <- condition$sample_sizes_group1
N2 <- condition$sample_sizes_group2
sd <- condition$standard_deviations
group1 <- rnorm(N1)
group2 <- rnorm(N2, sd=sd)
dat <- data.frame(group = c(rep('g1', N1), rep('g2', N2)), DV = c(group1, group2))
pars <- list(random_number = rnorm(1)) # just a silly example of a simulated parameter
#could just use return(dat) if no parameters should be tracked
return(list(dat=dat, parameters=pars))
}
Run the code above in your browser using DataLab