iris100 <- sim_df(iris, 100)
iris_species <- sim_df(iris, 100, between = "Species")
# set the names of within factors and (the separator character)
# if you want to return a long version
longdf <- sim_df(iris,
between = "Species",
within = c("type", "dim"),
sep = ".",
long = TRUE)
# or if you are simulating data from a table in long format
widedf <- sim_df(longdf,
between = "Species",
within = c("type", "dim"),
sep = ".")
Run the code above in your browser using DataLab