| augment_synthetic | R Documentation |
Add jointly resampled source variables to existing data
augment_synthetic(data, source, variables = NULL, seed = NULL)
data |
Destination base |
source |
Source base |
variables |
Variables to resample. |
seed |
Optional random seed. |
A simulab_sim base data.frame with the resampled variables added,
one source row drawn per row of data.
as.data.frame(x, what = "provenance") gives the source row each
destination row was drawn from.
source_data <- data.frame(x = stats::rnorm(100))
data <- data.frame(id = 1:20)
result <- augment_synthetic(data, source = source_data, variables = "x", seed = 1)
head(result)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.