View source: R/S3_classes_demog_change_component_utility_functions.R
make_value_ratio | R Documentation |
The ratio of the “value” columns in the numerator
(num
) and denominator (denom
) data frames is
calculated and returned. num
and denom
are first
merged on columns named by_vars_names
and these columns are
in the output, which is also a data frame.
make_value_ratio(num, denom, by_vars_names = NULL, all.x = TRUE, all.y = FALSE)
num |
A data frame with columns “ |
denom |
Similar to |
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 |
When by_vars_names
is NULL
, if denom
has
column time_span
and all entries are 0, “time_span”
will be omitted from by_vars_names
. Note: This only
happens if by_vars_names
is NULL
.
A data frame with columns “by_vars_names
” and
“value”, where the latter holds the ratio of
“value”s in num
and denom
.
Mark Wheldon
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.