expand_df | R Documentation |
expand_df()
is a wrapper around tidyr::expand_grid()
and dplyr::right_join()
that can be used to make missing values explicit within a data frame prior to
it being passed to a predict_...()
function.
expand_df(
df,
...,
response = "value",
keep_no_obs = TRUE,
keep_before_obs = FALSE,
sort_col = "year",
sort_descending = FALSE,
group_col = "iso3",
join_covariates = FALSE
)
df |
Data frame. |
... |
Named vectors to pass to expand grid. |
response |
Column name of response variables whose missing values will be
infilled and projected, defaults to |
keep_no_obs |
Logical value indicating whether or not to keep rows in the
expanded data frame when there is no data. Defaults to |
keep_before_obs |
Logical value indicating when data is available, whether or not
to keep rows in the expanded data frame that lie before the first observed point.
Defaults to |
sort_col |
Column name(s) to use to |
sort_descending |
Logical value on whether the sorted values from |
group_col |
Column name(s) of group(s) to use in |
join_covariates |
Logical value indicating whether or not to join the final
expanded data frame to the covariates_df data frame. If |
Expanded data frame with explicit missing values.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.