Description Usage Arguments Value See Also Examples
convertDf
is a helper function that
can convert a data.frame
into a SimDesign
object.
1 | convertDf(x)
|
x |
A |
A data.frame
object also of class SimDesign
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ## Not run:
n <- c(15, 30, 50)
sd <- c(0.5, 1, 2)
skew <- c(1, 5, 10)
dat <- expand.grid(N = n, SD = sd, Skew = skew,
KEEP.OUT.ATTRS = FALSE)
set.seed(123)
dat$Result1 <- rnorm(27)
dat$Result2 <- rnorm(27)
convertDf(dat) # Error: N, SD, and Skew not set as factors
dat[,1:3] <- lapply(dat[,1:3], as.factor)
newdat <- convert_df(dat)
str(newdat)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.