Generates a data table with a specified within and between design. See vignette("sim_design", package = "faux")
for examples and details.
sim_design(
within = list(),
between = list(),
n = 100,
mu = 0,
sd = 1,
r = 0,
empirical = FALSE,
long = FALSE,
dv = list(y = "value"),
id = list(id = "id"),
vardesc = list(),
plot = faux_options("plot"),
interactive = FALSE,
design = NULL,
rep = 1,
nested = TRUE,
seed = NULL,
sep = faux_options("sep")
)
a list of the within-subject factors
a list of the between-subject factors
the number of samples required
the means of the variables
the standard deviations of the variables
the correlations among the variables (can be a single number, full correlation matrix as a matrix or vector, or a vector of the upper right triangle of the correlation matrix
logical. If true, mu, sd and r specify the empirical not population mean, sd and covariance
Whether the returned tbl is in wide (default = FALSE) or long (TRUE) format
the name of the dv for long plots (defaults to y)
the name of the id column (defaults to id)
a list of variable descriptions having the names of the within- and between-subject factors
whether to show a plot of the design
whether to run the function interactively
a design list including within, between, n, mu, sd, r, dv, id, and vardesc
the number of data frames to return (default 1); if greater than 1, the returned data frame is nested by rep (if nested = TRUE)
Whether to nest data frames by rep if rep > 1
DEPRECATED use set.seed() instead before running this function
separator for factor levels
a tbl