View source: R/Data_handling.R
read_MeteoDBS | R Documentation |
Read single or multiple CSV meteorological data files at Czechglobe MeteoDBS format at given path and merge them together.
read_MeteoDBS(
path,
start = NULL,
end = NULL,
format = "%d.%m.%Y %H:%M",
shift.by = NULL,
allow_gaps = TRUE,
verbose = TRUE
)
path |
A string. The path to directory with CSV file(s) in Czechglobe MeteoDBS format. Other than CSV files are ignored. |
start , end |
A value specifying the first (last) value of the generated
date-time sequence in temporary column "timestamp". If |
format |
A character string. Format of |
shift.by |
A numeric value specifying the time shift (in seconds) to be applied to the date-time information. |
allow_gaps |
A logical value. If |
verbose |
A logical value. Should additional statistics about presence
of |
This utility function is adapted to Czechglobe MeteoDBS file structure but allows to change selected useful arguments that have preset default values. It also assures that date-time sequence is regular and equidistant.
In case that multiple files are present in the path
, the expectation
is that files represent meteorological variables for given site and different
periods. Function merges them vertically (along generated complete
timestamp). All original columns across all files excluding the last empty
one are kept. The order of variables keeps that of the first file loaded
(note that file ordering in path
is alphabetical not chronological)
and additional variables are appended if present in the following files. The
output "date/time" column is converted into class POSIXct
.
If you want to specify start
and end
arguments as strings and
you change also default shift.by
value, start
and end
arguments need to be adopted accordingly to account for that change. E.g. if
shift.by = -900
, then start = "2019-12-31 21:15:00", end =
"2019-12-31 23:15:00"
instead of start = "2019-12-31 21:30:00", end =
"2019-12-31 23:30:00"
.
Function introduces additional column "timestamp" for purposes of merging
with merge_eddy()
. This column is then removed as it is not included
in the original data.
A data frame is produced with additional attributes varnames
and units
assigned to each respective column.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.