proc_L1: Time-align Raw Dendrometer or Temperature Data

Description Usage Arguments Details Value Examples

View source: R/proc_L1.r

Description

proc_L1 aligns raw dendrometer and raw temperature data to regular time steps.

Usage

1
2
3
4
5
6
7
8
proc_L1(
  data_L0,
  reso = 10,
  input = "long",
  date_format = "%Y-%m-%d %H:%M:%S",
  year = "asis",
  tz = "UTC"
)

Arguments

data_L0

input data.frame containing raw dendrometer or temperature data (see Details for formatting requirements).

reso

numeric, desired output time resolution (in minutes). See Details for more information on data aggregation.

input

character, specify the structure of the input data (data_L0). Can either be in "long" format (i.e. sensors below each other with a series column separating the sensors) or in "wide" format (i.e. one sensor per column). See Details for more information on formatting requirements.

date_format

character, specify a custom date format if it is not "%Y-%m-%d %H:%M:%S".

year

character, if year = "asis" the output data.frame covers the same period as the input data; if year = "full" then the output data.frame is expanded to complete years, i.e. YYYY-01-01 to YYYY-12-31.

tz

specify the desired time zone. Default is "UTC".

Details

Data of multiple sensors can either be in long format (input = "long") with a column named series to differentiate the sensors or in wide format (input = "wide") with sensors in separate columns. If temperature data is provided in the same data.frame as dendrometer data, the name of the temperature sensor must contain the string temp. See the following vignette for examples of input data: vignette("Introduction-to-treenetproc", package = "treenetproc").

The time-alignment uses a linear interpolation between the two closest measurement points in the raw dataset to obtain the values at the specified time resolution. The linear interpolation is restricted to gaps that are smaller than 2.1 * reso (i.e. two timestamps). If data is already provided at regular time steps, the corresponding values are selected.

Value

a data.frame with measurements aligned to regular time intervals (interval specified in reso) containing the following columns:

series

name of the series.

ts

timestamp with format %Y-%m-%d %H:%M:%S.

value

dendrometer value.

version

package version number.

Examples

1
2
3
4
5
# Input data in 'long' format
proc_L1(data_L0 = dendro_data_L0)

# Input data in 'wide' format
proc_L1(data_L0 = dendro_data_L0_wide, input = "wide")

treenet/treenetproc documentation built on June 16, 2021, 4:39 p.m.