| simulate_synthetic | R Documentation |
Simulate row-bootstrap synthetic data
simulate_synthetic(
data,
n = nrow(data),
variables = NULL,
id = "id",
seed = NULL,
batch = NULL
)
data |
Source base |
n |
Number of synthetic observations. |
variables |
Variables to sample. |
id |
Identifier variable in the result. |
seed |
Optional random seed. |
batch |
Optional single positive whole number. When given, the
simulator runs |
A simulab_sim base data.frame with n rows of jointly resampled
values, the identifier column first. as.data.frame(x, what = "provenance")
gives the source row each synthetic row was drawn from.
source_data <- data.frame(id = 1:100, x = stats::rnorm(100), y = stats::runif(100))
result <- simulate_synthetic(source_data, n = 50, seed = 1)
head(result)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.