generate_test_data: Generate test data

Description Usage Arguments Details Author(s) Examples

View source: R/generate_test_data.R

Description

Function that utilizes the original dataset, the centers of the model to be analysed and weather information to create a test dataset that will be scaled and read to use in posteriror evaluations.

Usage

1
2
generate_test_data(input_data, center_mean, center_stddev, grid,
  weather_dataset, wt_f=NULL, scaled = T, soil_type = NULL, points=NULL)

Arguments

input_data

Dataset in sprad format containing LSUs as columns and cell numbers as rows

center_mean

Center attributes from scaled training data of the model used in the parameter model. Will be used if scale is set to TRUE. Example: train_data <- scale(train_data) col_means_train_harvest <- attr(train_data, "scaled:center")

center_stddev

Scale attributes from scaled training data of the model. Will be used if scale is set to TRUE.

grid

dataset with grid cells information. Has to be the same size as the input_data

weather_dataset

Data set containing weather information.

wt_f

koppen geiger climate classification dataset created by the file: koppen_geiger_pre_processing.R

scaled

Boolean that to define wheater the data will be scalled or not.

soil_type

Dataset with information on soil type on cell level.

points

A list of values that will substitute the orinal columns with the number of LSUs in case a more fine LSU resolution is desired for finding the optminal LSU. Ex: points = as.list(seq(0,25,0.5))

Details

If wt_t.Rdata is null all cells will be scalled and outputed, if wt_f is filled with the koppen geiger climate classification generated by the file: koppen_geiger_pre_processing.R. the EF an d ET climate zones will be removed from the analysis.

Author(s)

Marcos Alves mppalves@gmail.com

Examples

1
2
3
4
5
6
7
8
##Scalled test data
generate_test_data(map_harvest_real, col_means_train_harvest, col_stddevs_train_harvest, grid, weather_dataset, soil_type = soil)

##Unscaled test data
generate_test_data(map_harvest_real, col_means_train_harvest, col_stddevs_train_harvest, grid, weather_dataset, scaled = F, soil_type = soil)

##Unscaled test data with LSU points substitutes
generate_test_data(map_harvest_real, col_means_train_harvest, col_stddevs_train_harvest, grid, weather_dataset, scaled = F, soil_type = soil, points = as.list(seq(0,25,0.5)))

mppalves/GSTools documentation built on May 22, 2020, 7:21 p.m.