Aggregate data from datatable with a as.POSIXct date configuration and a TIMESTAMP column name. For that, use readRawFileBM to load data.

aggregateData(rawFileDatatable, aggregateFrq, confVariablePath)

Arguments

rawFileDatatable

datatable of the rawfile (output from readRawFileBM function)

aggregateFrq

string of aggregation frequency with a value, a space and the unit ("second", "min","hour","day","week","month","year")

confVariablePath

path and names of mappingFiles

Value

data.table with aggregation value link to aggregateFrq defined

Examples

# Data rawFilePath <- system.file("extdata/bm-cent_L03-atm/0_rawdata/F01-30s/", "lqu_bm-cent_L03-atm_F01-30s_2021_05_17_0000.dat", package = "aigoual") # Conf file confVariablePath <- system.file("extdata/_config/", "bmVariablesMapping.csv", package = "aigoual") # File parameters decC <- "." skipRow <- c(1,2) timestampColumn <- "TIMESTAMP" timestampFormat <- "%Y-%m-%d %H:%M:%S" timestampTZ <- "Africa/Algiers" #1. Read data rawFileDatatable <- readRawFileBM(fileInput=TRUE, rawFilePath,decC, skipRow,timestampColumn, timestampFormat,timestampTZ) #2. Aggregate aggregateFrq <- "1 day" data <- aigoual::aggregateData(rawFileDatatable,aggregateFrq,confVariablePath)