View source: R/functioncollection_Harmonized.R
WriteHarmonizedData | R Documentation |
This is a convenience wrapper function to export a data frame to the required Harmonized Data File format. See the HYPEObsMetadataTools documentation.
WriteHarmonizedData(
df,
filename = "",
replace.accents = FALSE,
strip.punctuation = FALSE,
ignore.cols = NULL,
nThread = NULL
)
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. If |
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.
WriteHarmonizedData
exports a CSV file if filename
is specified. Otherwise, the function outputs a data frame to the console.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.