wt_preprocess: wt_preprocess

Description Usage Arguments Examples

View source: R/wt_preprocess.R

Description

Preprocessing data for stream water temperature prediction. All results are stored automatically in the folder catchment in the current working directory.

Usage

1
2
3
4
5
6
7
wt_preprocess(
  data,
  nlags = 4,
  training_fraction = 0.8,
  year_range = c(min(data$year), max(data$year)),
  catchment = deparse(substitute(data))
)

Arguments

data

data frame containing the variables: year, month, day, wt and additional covariates.

nlags

Number of lags used for for all features except for time features.

training_fraction

Numeric of fraction of data used for training, e.g. 0.8. Testing data will consist of the (1-training_fraction) fraction of data.

year_range

Vector containing the first and last year to use. Only relevant in case not all available years should be used.

catchment

Character used to create the folder in which the resulting preprocessed training and test data sets get stored.

Examples

1
2
3
4
5
6
7
## Not run: 
data(test_catchment)
wt_preprocess(test_catchment)
train_data <- feather::read_feather("test_catchment/train_data.feather")
test_data <- feather::read_feather("test_catchment/test_data.feather")

## End(Not run)

MoritzFeigl/wateRtemp documentation built on Sept. 6, 2021, 6:58 a.m.