-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make double dot work with mcapply #59
Comments
@kgoldfeld this has to do with environments, I will look into how to maybe find way to solve this differntly but for now you can just use library(simstudy)
def <- defData(varname = "age", formula=10, dist = "nonrandom")
def <- defData(def,
varname = "agemult",
formula = "age * ..age_effect", dist = "nonrandom"
)
myreplicate <- function(x, def) {
age_effect <<- x
genData(2, def)
}
lapply(c(0, 5, 10), function(x) myreplicate(x, def))
#> [[1]]
#> id age agemult
#> 1: 1 10 0
#> 2: 2 10 0
#>
#> [[2]]
#> id age agemult
#> 1: 1 10 50
#> 2: 2 10 50
#>
#> [[3]]
#> id age agemult
#> 1: 1 10 100
#> 2: 2 10 100 Created on 2020-10-03 by the reprex package (v0.3.0.9001) |
maybe explaining this trick for simulations would be somethign for the double dot vignette #52 |
assignUser
changed the title
male double dot work with mcapply
make double dot work with mcapply
Oct 3, 2020
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
as mentioned in #41 thie does not work but should:
The text was updated successfully, but these errors were encountered: