collate_proc_data: Collate processed data generated by any of the 'collate'...

View source: R/data_handling.R

collate_proc_dataR Documentation

Collate processed data generated by any of the 'collate' functions

Description

collate_proc_data collates multiple data frames generated by any of the 'collate' functions. This may be useful when, for example, data generated by different ST scenarios and/or 'standard' scenario runs are to be combined into a unique dataframe that can then be passed to other functions.

Usage

collate_proc_data(data, save2disk = TRUE, dir_out = "ProcessedData")

Arguments

data

A list where each element is a df from collate_[dat, yr, run]

save2disk

Whether to save the data as rda and csv, default: TRUE

dir_out

The local path to store the output. Default: ProcessedData

Details

Only dfs generated by the same function can be combined together. Missing data are filled with NA.

When save2disk=TRUE the output file will be named 'CombinedDB'. dir_out is created within the working directory unless a full path is provided.

Value

A data.frame with the collated data. Missing data are filled with NA.

Examples

# Using Campbell et al. example data. See ?sta.main, ?sta.evy5, ?sta.evy5.b11
# for more details.
data(sta.main, sta.evy5, sta.evy5.b11)
dfs <- list(sta.main, sta.evy5, sta.evy5.b11)
combined <- collate_proc_data(dfs, save2disk=FALSE)

carlopacioni/vortexR documentation built on May 6, 2022, 12:07 p.m.