WriteHarmonizedData {HYPEtools} | R Documentation |
Write a Harmonized Data File
Description
This is a convenience wrapper function to export a data frame to the required Harmonized Data File format. See the HYPEObsMetadataTools documentation.
Usage
WriteHarmonizedData(
df,
filename = "",
replace.accents = FALSE,
strip.punctuation = FALSE,
ignore.cols = NULL,
nThread = getDTthreads()
)
Arguments
df |
Data frame containing the harmonized data. |
filename |
Path to and file name (including ".csv" file extension) of the Harmonized Data CSV file to export. Windows users: Note that Paths are separated by '/', not '\'. |
replace.accents |
Logical, if |
strip.punctuation |
Logical, if |
ignore.cols |
Vector of columns in |
nThread |
Integer, set number of threads to be used when writing file. See |
Details
WriteHarmonizedData
is a convenience wrapper function of fread
to export harmonized data in the HYPEObsMetadataTools Harmonized Data Format.
The function checks that all required columns are present, includes options to format strings, and exports data to output CSV files with the correct encoding and formatting.
Value
WriteHarmonizedData
exports a CSV file if filename
is specified. Otherwise, the function outputs a data frame to the console.
Examples
df <- data.frame(
"STATION_ID" = "A1",
"DATE_START" = "2002-06-18 12:00",
"DATE_END" = "2002-06-18 12:00",
"PARAMETER" = "NH4_N",
"VALUE" = 0.050,
"UNIT" = "mg/L",
"QUALITY_CODE" = "AA"
)
WriteHarmonizedData(df)