| runSimFromFixedValues | R Documentation |
runSimFromFixedValues offers a way to configure and run a simulation from fixed values for race, sex, and birth year cohort rather than passing a data frame. It returns a dataframe of simulated smoking histories for n individuals.
repeat |
The number of individuals to simulate |
race |
(default = 0 and refers to all races combined) |
sex |
(0 for male, 1, for female) |
cohort_year |
(four digit birth cohort year) |
If attach_run_info = FALSE, a data.frame of repeat
simulated individuals with columns smoking_initiation_age (-999 =
never smoker), smoking_cessation_age, age_at_death, and
cigarettes_per_day. If attach_run_info = TRUE, the same four-component
bundle as shg_run; see that help page for definitions.
shg <- new(SHGInterface)
shg$input_data_folder <- system.file("extdata", "2018", package = "SmokingHistoryGenerator")
hist <- shg$runSimFromFixedValues(500, 0, 0, 1950)
head(hist)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.