Learn R Programming

vortexR (version 1.1.7)

collate_proc_data: 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

Value

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

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.

Examples

Run this code
# NOT RUN {
# 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)
# }

Run the code above in your browser using DataLab