fert_rate_age_f: Constructor for class 'fert_rate_age_f'

View source: R/S3_classes_ccmpp_input_fert_rate_df.R

fert_rate_age_fR Documentation

Constructor for class fert_rate_age_f

Description

fert_rate_age_f is a subclass of ccmpp_input_df. It imposes four additional conditions:

  1. The value_type attribute is “rate”.

  2. All elements of the “value” column must be non-negative.

  3. There can be no 'sex' dimension; all fertility rate inputs must be female fertility rates.

  4. An additional attribute non_zero_fert_ages, which specifies the reproductive age range as a vector of age_start values (see “Details”).

Usage

fert_rate_age_f(x, ...)

## S3 method for class 'data.frame'
fert_rate_age_f(
  x,
  non_zero_fert_ages = attr(x, "non_zero_fert_ages"),
  value_scale = attr(x, "value_scale")
)

## S3 method for class 'ccmpp_input_list'
fert_rate_age_f(x)

fert_rate_age_f(x) <- value

Arguments

x

An object for which a method is defined (see “Details”).

...

Passed to the low-level constructor.

non_zero_fert_ages

Numeric vector of unique ages indicating the reproductive age range. See the “Details” section.

value_scale

Numeric scalar indicating the value_scale of the counts, e.g., 1, 1000, 1e6, etc.

Details

Methods are defined for data.frames and ccmpp_input_lists, and possibly other objects as well. The data.frame method “constructs” an object from x. The ccmpp_input_list method “extracts” an object from x. There is also a replacement function which complements the extraction methods.

An attempt will be made to guess non_zero_fert_ages if they are not explicitly specified using the non_zero_fert_ages argument.

If non_zero_fert_ages are specified, they must be a subset of ages(x) and be equally spaced with spacing equal to age_span(x).

Elements of the value column corresponding to ages not listed in non_zero_fert_ages will be overwritten with zeros (specifically as.double(0)s).

Value

An object of class fert_rate_age_f.

Author(s)

Mark Wheldon

See Also

validate_ccmppWPP_object for object validation, ccmpp_input_df for the class from which this one inherits.

Other ccmpp_input_objects: ccmpp_input_df(), ccmpp_input_list(), coerce_pop_count_age_sex_reference, death_count_age_sex(), death_probability_age_sex(), life_table_age_sex(), mig_net_count_age_sex(), mig_net_count_tot_b(), mig_net_rate_age_sex(), mig_parameter(), mort_rate_age_sex(), pop_count_age_sex_base(), srb(), survival_ratio_age_sex()


markalava/ccmppWPP documentation built on April 21, 2022, 12:36 a.m.