Compile data from a folder or a selection of file. This function is can also be used in a shiny app.

compileData(
  pathToCompile,
  outputCompile = FALSE,
  extensionFile = "*.dat",
  compileFrq,
  dateFilePattern = "campbell",
  decC = ".",
  skipRow = c(1, 2),
  timestampColumn = "TIMESTAMP",
  timestampFormat = "%Y-%m-%d %H:%M:%S",
  timestampTZ = "Africa/Algiers"
)

Arguments

pathToCompile

path of folder contain raw files (ex. 1_BRUTE_meteosol/03-02-2016_actuel/) or vector of rawfiles to compile

outputCompile

path ot folder for write file compile (ex. output/). If False, return data.table

extensionFile

pattern of file extension to compile (default "*.dat")

compileFrq

Compilation granularity (year, month or day)

dateFilePattern

Type of the suffix of file with date pattern ("campbell" or "ICOS") with : campbell : AAAA_MM_JJ_HHSS.dat ICOS : AAAAMMJJ_LXX_FXX.csv

decC

Decimal (",", ".")

skipRow

Number of row to skip (e.g header and unit c(1,2). FALSE to don't skip row)

timestampColumn

Name of timestamp column

timestampFormat

Timestamp format (eg. "%d/%m/%Y %H:%M")

timestampTZ

Timestamp timezone (eg. "Africa/Algiers")

Value

Write a compile file (compile_nameFile.csv) or return a data.table

Examples

# Exemple d'application de la fonction compileData # Répertoire contenant les données à compiler pathToCompile <- system.file("extdata/bm-cent_L03-atm/0_rawdata/F01-30s/", package = "aigoual") # Fréquence de compilation des données compileFrq <- "month" # Répertoire pour la sortie des fichiers compilés outputCompile <- tempdir() # Lancement de la compilation compileData(pathToCompile,outputCompile,extensionFile="*.dat",compileFrq)