It is useful to be able to simulate data with a specified structure. The faux package provides some functions to make this process easier. See the vignettes for more details.

Installation

You can install the newest version of faux from GitHub with:

devtools::install_github("debruine/faux", build_vignettes = TRUE)

Because faux is still in early development, some features will break in future versions. Include sessioninfo::package_info() in your script to list the versions of all loaded packages.

Quick overview

Simulate data for a factorial design

Default design plot

Default design plot

p1 <- plot_design(df)
p2 <- plot_design(df, "pet", "time")

cowplot::plot_grid(p1, p2, nrow = 2, align = "v")
Plot the data with different visualisations.

Plot the data with different visualisations.

Simulate new data from an existing data table

new_iris <- sim_df(iris, 50, between = "Species") 
Simulated iris dataset

Simulated iris dataset