Subfunction for aggregating or splitting data files. Needs to be called from ContDataQC(). Combines (appends) all provided filesp. Saves a new CSV in the export directory. The 'file' version works on a vector of files.
Vector of file names.
Directory for import data. Default is current working directory.
Directory for export data. Default is current working directory.
Report format (docx or html). Default is specified in config.R (docx). Can be customized in config.R; ContData.env$myReport.Format.
Report (rmd) template folder. Default is the package rmd folder. Can be customized in config.R; ContData.env$myReport.Dir.
Boolean parameter to create reports or not. Default = TRUE.
Returns a csv into the specified export directory of each file appended into a single file.
#Not intended to be accessed indepedant of function ContDataQC().
myFile <- c("QC_test2_Aw_20130426_20130725.csv"
, "QC_test2_Aw_20130725_20131015.csv"
, "QC_test2_Aw_20140901_20140930.csv")
myDir.import <- file.path(getwd(),"Data2_QC")
myDir.export <- file.path(getwd(),"Data3_Aggregated")
fun.AggregateData.File(myFile, myDir.import, myDir.export)
#> [1] "Total files to process = 3"
#> [1] "ERROR; no such file exits. Cannot QC the data."
#> [1] "PATH = /private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/RtmpZn7gXz/filee71552aa7c0/reference/Data2_QC"
#> [1] "FILE = QC_test2_Aw_20130426_20130725.csv"
#> Error in fun.AggregateData.File(myFile, myDir.import, myDir.export): Bad file.