value_scale: Create, extract and set a "value_scale"

View source: R/S3_classes_value_scale.R

value_scaleR Documentation

Create, extract and set a “value_scale”

Description

These functions extract and set the “value_scale” attributes of objects inheriting from demog_change_component_df. This attribute is displayed differently depending on the class and other attributes of its parent object. If you are comparing “value_scales” with, e.g., identical you should use value_scale_numeric (see “Details”).

Usage

value_scale(x)

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

value_scale_numeric(x)

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

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

value_scale(x, ...) <- value

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

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

Arguments

x

An object inheriting from demog_change_component_df.

Details

The object returned by value_scale is given class [prefix]_value_scale. [prefix] can currently be either demog_change_component_df or ccmpp_input_df depending on the class of the input x. This is currently the only (exported) way of creating objects of these types; the class is used only to control the \print method. As a consequence, for example, attr(x, "value_scale") will return the unclassed, numeric, value, not an object of class [prefix]_value_scale (but see function value_scale_numeric below).

Function value_scale_numeric returns a numeric (double) scalar (via as.double) with no class attribute. It is suitable for use with identical when comparing the “value_scale”s of different objects.

Value

For value_scale, an object of class [prefix]_value_scale. For value_scale_numeric a numeric scalar with no class. See “Details”.

Author(s)

Mark Wheldon

See Also

Other extract_attributes: extract_ccmpp_input_list_attributes, non_zero_fert_ages()


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