data_prep_all: Prepare the dataset: convert to thousands when needed,...

View source: R/data_prep_all.R

data_prep_allR Documentation

Prepare the dataset: convert to thousands when needed, restrict to individuals present at least n_min_years, remove outliers and split in train and test sets

Description

Prepare the dataset: convert to thousands when needed, restrict to individuals present at least n_min_years, remove outliers and split in train and test sets

Usage

data_prep_all(
  data,
  n_min_years = 5,
  normalize = TRUE,
  reduce_mil = FALSE,
  outliers_custom_cutoff = NULL,
  split_pct_train = 0.9
)

Arguments

data

A data.frame: the full dataset

n_min_years

An integer giving the minimal number of years a farm should appeared in the data to be selected

normalize

A logical indicating if numerical variables should be normalized

reduce_mil

A logical indicating if thousands conversion should be done

outliers_custom_cutoff

Threshold to identified outliers

split_pct_train

Ratio between train and test data

Value

A list of data.frame: train and test sets


cottinlola/modeleVariablesAP documentation built on April 30, 2022, 7:42 a.m.