rmw_nest_for_modelling {rmweather} | R Documentation |
Function to nest observational data before modelling with rmweather.
Description
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.
Usage
rmw_nest_for_modelling(
df,
by = "resampled_set",
n = 1,
na.rm = FALSE,
fraction = 0.8
)
Arguments
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. |
Value
Nested tibble.
Author(s)
Stuart K. Grange
See Also
rmw_prepare_data
, rmw_model_nested_sets
,
rmw_predict_nested_sets
Examples
# 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)
[Package rmweather version 0.2.6 Index]