View source: R/S3_classes_demog_change_component_utility_functions.R
abridge | R Documentation |
demog_change_component_df
objectThis is a generic function with methods for the various sub-classes
of ccmpp_input_df
. It abridges the first argument, x
,
such that the result has spans or ages and times as supplied in the
span_abridged
, age_start_abridged
and
time_start_abridged
arguments. See “Details” for
restrictions on specifying the arguments.
abridge(x, ...) ## S3 method for class 'demog_change_component_df' abridge( x, age_span_abridged = NULL, time_span_abridged = NULL, age_start_abridged = NULL, time_start_abridged = NULL, out_class = class(x)[1], ... )
x |
An object inheriting from
|
... |
Other arguments passed to other methods. |
age_span_abridged |
A numeric scalar giving the new
|
time_span_abridged |
As |
age_start_abridged |
Vector of new |
time_start_abridged |
As |
out_class |
See same argument for
|
If you specify age_span_abridged
you cannot specify
age_start_abridged
, and similarly for
time_span_abridged
and time_start_abridged
. If you
specify only one of “age” and “time”, all levels of
the other are kept if x
has the corresponding demographic
dimension. Moreover, abridging is done within levels of “sex” and
“indicators” if x
has those dimensions.
This function calls
aggregate.data.frame
to do the actual
abridging.
If you get an error along the lines of “result is invalid as
a member of the class” or similar, it means that, after abridging,
the result is no longer valid as a member of the class x
has. This would occur, for example, if x
inherits from
ccmpp_input_df
and you only supplied one of the
..._start_abridged
arguments. Try supplying both or,
instead, specify span_abridged
.
An object of the same class as x
, abridged.
Mark Wheldon
aggregate
which this function relies
on, link{collapse_demog_dimension}
for a related
function.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.