View source: R/S3_classes_demog_change_component_df.R
demog_change_component_df | R Documentation |
demog_change_component_df
demog_change_component_df( x, value_type = attr(x, "value_type"), value_scale = attr(x, "value_scale"), ... ) ## S3 method for class 'summary_fert_rate_age_f' print(x, vsep, ..., print_what = c("info", "table"))
x |
For |
value_type |
Scalar indicating the type of the “value” column (e.g., “count”, “rate”, etc.). |
value_scale |
Numeric scalar indicating the value_scale of the
counts, e.g., |
... |
Passed to the low-level constructor. |
demog_change_component_df
is the
parent class of a family of classes for holding age- time-specific
demographic vital rates, such as fertility and mortality rates,
population counts, and migration rates. It is not intended as a
class for raw data; only one value per age and period is
permitted. Rather, it is intended to be useful to ensure that
objects passed to functions that expect demographic values as
input are correctly formatted.
Objects of this class have class attribute
c("demog_change_component_df", "data_frame")
.
The class is based on a data frame with age-sex-specific vital rates for one or more time periods in a column named “value”.
See the help files for the other constructor functions under “See also” for further details specific to each type of vital rate or parameter.
An object of class demog_change_component_df
.
**TBC** (details of the class) 1. Must be sorted properly.
**TBC**
**ISSUES OUTSTANDING** ======================
SORTING: ——–
Correct ordering by 'age_start' and 'time_start' is required for the ccmpp functions (right?) What about by 'sex'? The sample inputs are sorted by sex first (varying slowest) but with 'male' first, so in reverse alphabetical order.
FACTORS vs CHARACTERS: ———————–
'sex' is a categorical variable and encoding it as a factor could be justified. However it may be easier to encode as character and have methods convert to factor when advantageous. NOTE that ordering is important; see 'sex_as_factor()' and friends.
Mark Wheldon
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.