View source: R/S3_classes_value_scale.R
value_scale | R Documentation |
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”).
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)
x |
An object inheriting from
|
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.
For value_scale
, an object of class
[prefix]_value_scale
. For
value_scale_numeric
a numeric scalar with no class. See
“Details”.
Mark Wheldon
Other extract_attributes:
extract_ccmpp_input_list_attributes
,
non_zero_fert_ages()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.