Description Usage Arguments Note Author(s) Examples
Write data in Station Exchange Format version 1.0.0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
Data |
A data frame with 6 variables in this order: year, month, day, hour, minute, value. |
outpath |
Character string giving the output path (note that the filename is generated from the source identifier, station code, start and end dates, and variable code). By default this is the working directory. |
variable |
Variable code. This is a required field. |
cod |
Station code. This is a required field. |
nam |
Station name. |
lat |
Station latitude (degrees North in decimal). |
lon |
Station longitude (degreees East in decimal). |
alt |
Station altitude (metres). |
sou |
Character string giving the source identifier. |
link |
Character string giving an url for metadata (e.g., link to the C3S Data Rescue registry). |
units |
Character string giving the units. This is a required field. |
stat |
Character string giving the statistic code. This is a required field. |
metaHead |
Character string giving metadata entries for the header (pipe separated). |
meta |
Character vector with length equal to the number of rows
of |
period |
Observation time period code. Must be a character vector with
length equal to the number of rows of |
time_offset |
Numerical vector of offsets from UTC in hours. This value will be subtracted from the observation times to obtain UTC times, so for instance the offset of Central European Time is +1 hour. Recycled for all observations if only one value is given. |
note |
Character string to be added to the end of the standard output filename. It will be separated from the rest of the name by an underscore. Blanks will be also replaced by underscores. |
keep_na |
If FALSE (the default), lines where observations are NA are removed. |
outfile |
Output filename. If specified, ignores |
Times in SEF files must be expressed in UTC.
If outfile
is not specified, the output filename is generated
automatically as sou
_cod
_startdate_enddate_variable
.tsv
Yuri Brugnara
1 2 3 4 5 6 7 | # Create a basic SEF file for air temperature in Bern
# (assuming the observation times are in local solar time)
# The file will be written in the working directory
meta_bern <- Meta$ta[which(Meta$ta$id == "Bern"), ]
write_sef(Bern$ta[, 2:7], variable = "ta", cod = meta_bern$id, lat = meta_bern$lat,
lon = meta_bern$lon, alt = meta_bern$alt, units = meta_bern$units,
stat = "point", period = "0", time_offset = meta_bern$lon * 24 / 360)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.