View source: R/functioncollection_Harmonized.R
WriteHarmonizedSpatialDescription | R Documentation |
This is a convenience wrapper function to export a data frame to the required Harmonized Spatial Description File format. See the HYPEObsMetadataTools documentation.
WriteHarmonizedSpatialDescription(
df,
filename = "",
replace.accents = FALSE,
strip.punctuation = FALSE,
ignore.cols = NULL,
nThread = NULL
)
df |
Data frame containing the harmonized spatial description data. |
filename |
Path to and file name (including ".csv" file extension) of the Harmonized Spatial Description 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 |
WriteHarmonizedSpatialDescription
is a convenience wrapper function of fread
to export harmonized spatial description data in the HYPEObsMetadataTools Harmonized Spatial Description 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.
WriteSpatialDescrption
exports a CSV file if filename
is specified. Otherwise, the function outputs a data frame to the console.
df <- data.frame(
"STATION_ID" = "A1",
"SRC_NAME" = "Example",
"DOWNLOAD_DATE" = "2022-10-19",
"SRC_STATNAME" = "Station",
"SRC_WBNAME" = "River",
"SRC_UAREA" = NA,
"SRC_XCOORD" = 28.11831,
"SRC_YCOORD" = -25.83053,
"SRC_EPSG" = 4326,
"ADJ_XCOORD" = 28.11831,
"ADJ_YCOORD" = -25.83053,
"ADJ_EPSG" = 4326
)
WriteHarmonizedSpatialDescription(df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.