extract_demog_change_component_attributes: Extract specific components

non_zero_fert_agesR Documentation

Extract specific components

Description

These functions extract specific components (attributes, factor levels, values, etc.) from objects inheriting from demog_change_component_dfs. They return the “levels” of the component, not the whole column from the data frame. If the whole column is required use the usual subsetting functions such as base::[. See “Extracting and replacing values” for the operation of values and values<-, which are a bit different.

Usage

non_zero_fert_ages(x)

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

non_zero_fert_ages(x, ...) <- value

## S3 replacement method for class 'fert_rate_age_f'
non_zero_fert_ages(x, ...) <- value

values(x)

## S3 method for class 'demog_change_component_df'
values(x)

values(x) <- value

## S3 replacement method for class 'demog_change_component_df'
values(x) <- value

ages(x)

## S3 method for class 'demog_change_component_df'
ages(x)

times(x)

## S3 method for class 'demog_change_component_df'
times(x)

sexes(x)

## S3 method for class 'demog_change_component_df'
sexes(x)

indicators(x)

## S3 method for class 'demog_change_component_df'
indicators(x)

value_type(x)

## S3 method for class 'demog_change_component_df'
value_type(x)

value_type(x, ...) <- value

## S3 replacement method for class 'demog_change_component_df'
value_type(x, ...) <- value

age_span(x)

## S3 method for class 'ccmpp_input_df'
age_span(x)

## S3 method for class 'ccmpp_output_df'
age_span(x)

time_span(x)

## S3 method for class 'ccmpp_input_df'
time_span(x)

## S3 method for class 'ccmpp_output_df'
time_span(x)

## S3 method for class 'pop_count_age_sex_reference'
time_span(x)

## S3 replacement method for class 'ccmpp_input_df'
value_type(x, ...) <- value

## S3 replacement method for class 'ccmpp_output_df'
value_type(x, ...) <- value

## S3 method for class 'ccmpp_input_df_value_scale'
print(x, ...)

Arguments

x

An object from which to extract attributes.

Value

The “levels” of the extracted component (except possibly for values; see “Details”).

Extracting and replacing values

If value_type(x) is not "categorical" then value(x) will return x$value as it is assumed all are unique. The replacement function values<- replaces the "value" column, using the usual recycling rules (see data.frame), and attempts to return an object the same class as x. If the replacement renders the object invalid as a member of the class an error will be signaled.

Author(s)

Mark Wheldon

See Also

Other extract_attributes: extract_ccmpp_input_list_attributes, value_scale()


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