View source: R/S3_classes_demog_change_component_utility_functions.R
make_value_product | R Documentation |
The product of the “value” columns in data frames x
and y
is calculated and returned. x
and
y
are first merged on columns named by_vars_names
and these columns are in the output, which is also a data frame.
make_value_product(x, y, by_vars_names = NULL, all.x = TRUE, all.y = FALSE)
x, y |
Data frames with columns “ |
by_vars_names |
Character vector of names of columns to merge by. By default, all columns except “value”. See also “Details”. |
all.x |
logical; if |
all.y |
logical; analogous to |
Special processing occurs when by_vars_names
is NULL
and either x
or y
has column time_span
and all
entries are 0. In this case, before merging, “time_span” is
omitted from by_vars_names
and the time_span
column
is dropped from y
. This ensures the result has only one
time_span
column, namely the one from x
.
A data frame with columns “by_vars_names
” and
“value”, where the latter holds the product of
“value”s in x
and y
.
Mark Wheldon
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.