View source: R/rmw_nest_for_modelling.R
rmw_nest_for_modelling | R Documentation |
rmw_nest_for_modelling
will resample the observations if desired, will
test and prepare the data (with rmw_prepare_data
), and return
a nested tibble ready for modelling.
rmw_nest_for_modelling(
df,
by = "resampled_set",
n = 1,
na.rm = FALSE,
fraction = 0.8
)
df |
Input data frame. Generally a time series of air quality data with pollutant concentrations and meteorological variables. |
by |
Variables within |
n |
Number of resampling sets to create. |
na.rm |
Should missing values (NA) be removed from value? |
fraction |
Fraction of the observations to make up the training set. |
Nested tibble.
Stuart K. Grange
rmw_prepare_data
, rmw_model_nested_sets
,
rmw_predict_nested_sets
# Load package
library(dplyr)
# Keep things reproducible
set.seed(123)
# Prepare example data for modelling, replicate observations twice too
data_london %>%
rmw_nest_for_modelling(by = c("site", "variable"), n = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.