Skip to content

Instantly share code, notes, and snippets.

@ihrke
Created May 31, 2017 14:52
Show Gist options
  • Select an option

  • Save ihrke/c54e8d7c82cd91ae51d1d62f8d29b936 to your computer and use it in GitHub Desktop.

Select an option

Save ihrke/c54e8d7c82cd91ae51d1d62f8d29b936 to your computer and use it in GitHub Desktop.
how to use (mc)lapply together with expand.grid
library(tidyverse)
effs=seq(0, 1.0, by=0.05) # effect-sizes for which to calculate the design
rscales=c(sqrt(2)/2, 1, sqrt(2))
pars <- expand.grid(effs, rscales) %>% setNames(c("eff", "rscale"))
pars
lapply(data.frame(t(pars)), function(x) print(x))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment