-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathread_EddyPro.Rd
82 lines (73 loc) · 3.43 KB
/
read_EddyPro.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Data_handling.R
\name{read_EddyPro}
\alias{read_EddyPro}
\title{Read EddyPro Files with Units}
\usage{
read_EddyPro(
path,
start = NULL,
end = NULL,
skip = 1,
fileEncoding = "UTF-8",
format = "\%Y-\%m-\%d \%H:\%M",
shift.by = NULL,
allow_gaps = TRUE
)
}
\arguments{
\item{path}{A string. The path to directory with EddyPro full output. Other
than CSV files are ignored.}
\item{start, end}{A value specifying the first (last) value of the column
"timestamp" in outputted data frame. If \code{NULL}, \code{\link{min}}
(\code{\link{max}}) of date-time values from "timestamp" column across all
input files is used. If numeric, the value specifies the year for which the
first (last) date-time value will be generated, considering given time
interval (automatically detected from "timestamp" column) and convention of
assigning of measured records to the end of the time interval. Otherwise,
character representation of specific date-time value is expected in given
\code{format} and timezone "GMT".}
\item{skip}{An integer. The number of lines to skip in the input file before
reading data.}
\item{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 \code{\link{read.table}} for further details.}
\item{format}{A character string. Format of \code{start} (\code{end}) if
provided as a character string.}
\item{shift.by}{A numeric value specifying the time shift (in seconds) to be
applied to the date-time information.}
\item{allow_gaps}{A logical value. If \code{TRUE}, date-time information does
not have to be regular but time differences must be multiples of
automatically detected time interval.}
}
\value{
A data frame is produced with additional attributes \code{varnames}
and \code{units} assigned to each respective column.
}
\description{
Read single or multiple CSV EddyPro full output files at given path and merge
them together.
}
\details{
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 \code{POSIXct}. It also assures
that date-time sequence is regular and equidistant.
In case that multiple files are present in the \code{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 \code{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 \code{start} and \code{end} arguments as strings and
you change also default \code{shift.by} value, \code{start} and \code{end}
arguments need to be adopted accordingly to account for that change. E.g. if
\code{shift.by = -900}, then \code{start = "2019-12-31 21:15:00", end =
"2019-12-31 23:15:00"} instead of \code{start = "2019-12-31 21:30:00", end =
"2019-12-31 23:30:00"}.
Note that \code{skip} and \code{fileEncoding} arguments must be valid across
all files, otherwise the function will not execute correctly.
}