Simulate a vector from a summary object.
Usage
# S3 method for class 'summary_ordered'
simulate(summary, output_length, seed = NULL, ...)
# S3 method for class 'summary_treatment_flag'
simulate(summary, ...)
# S3 method for class 'summary_stratified'
simulate(summary, strata, seed = NULL, ...)
simulate(summary, ...)
# S3 method for class 'summary_character'
simulate(summary, output_length, seed = NULL, ...)
# S3 method for class 'summary_Date'
simulate(summary, output_length, seed = NULL, ...)
# S3 method for class 'summary_POSIXct'
simulate(summary, output_length, seed = NULL, ...)
# S3 method for class 'summary_difftime'
simulate(summary, output_length, seed = NULL, ...)
# S3 method for class 'summary_integer'
simulate(summary, output_length, seed = NULL, ...)
# S3 method for class 'summary_double'
simulate(summary, output_length, seed = NULL, ...)
# S3 method for class 'summary_id'
simulate(summary, output_length, ...)
# S3 method for class 'summary_flag'
simulate(summary, output_length, seed = NULL, ...)Arguments
- summary
summary- output from a glimpse function.- output_length
integer- number of rows to simulate.- seed
integer- random seed for reproducibility.- ...
additional arguments passed to methods.
- strata
vector- stratum value per output row (e.g. PARAMCD). Every stratum was seen during glimpse, so each has a child summary.
Methods (by class)
simulate(summary_ordered): simulate ordered columns by sampling from unique combinations.simulate(summary_treatment_flag): simulate treatment and flag columns by preserving exact counts for each combination.simulate(summary_stratified): simulate a stratified column (from.glimpse_stratified()) by drawing each row from its stratum's child summary, matched positionally against the stored levels (NA-safe).simulate(summary_character): simulate a character vector by sampling from unique values.simulate(summary_Date): simulate a Date vector by sampling uniformly between min and max.simulate(summary_POSIXct): simulate a POSIXct vector by sampling uniformly between min and max.simulate(summary_difftime): simulate a difftime vector by sampling uniformly between min and max.simulate(summary_integer): simulate an integerish vector by sampling uniformly between min and max and rounding.simulate(summary_double): simulate a double vector by sampling uniformly between min and max.simulate(summary_id): simulate an ID vector by generating sequential IDs.simulate(summary_flag): simulate a flag vector by sampling Y/N in proportion to input.