View source: R/Data_handling.R
read_EddyPro | R Documentation |
Read single or multiple CSV EddyPro full output files at given path and merge them together.
read_EddyPro(
path,
start = NULL,
end = NULL,
skip = 1,
fileEncoding = "UTF-8",
format = "%Y-%m-%d %H:%M",
shift.by = NULL,
allow_gaps = TRUE
)
path |
A string. The path to directory with EddyPro full output. Other than CSV files are ignored. |
start , end |
A value specifying the first (last) value of the column
"timestamp" in outputted data frame. If |
skip |
An integer. The number of lines to skip in the input file before reading data. |
fileEncoding |
A character string. If non-empty, declares the encoding
used on a file (not a connection) so the character data can be re-encoded.
See |
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 |
This utility function is adapted to EddyPro full output file structure but
allows to change selected useful arguments that have preset default values.
Column "timestamp" with date-time information is constructed based on "date"
and "time" columns and converted into class POSIXct
. It also assures
that date-time sequence is regular and equidistant.
In case that multiple files are present in the path
, function merges
them vertically (along generated complete timestamp) and discards rows with
duplicated date-time values. All original columns across all files 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. To assure
compatibility with older EddyPro versions, old column name "max_speed" is
renamed to "max_wind_speed" if present.
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"
.
Note that skip
and fileEncoding
arguments must be valid across
all files, otherwise the function will not execute correctly.
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.