download_treenet: Download Dendrometer Data from TreeNet or Decentlab Server

Description Usage Arguments Value Examples

View source: R/download_treenet.R

Description

download_treenet loads L0, L1 or L2 dendrometer data from the TreeNet or Decentlab server.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
download_treenet(
  site = NULL,
  sensor_name = NULL,
  sensor_class = NULL,
  from = NULL,
  to = NULL,
  bind_df = TRUE,
  server = "treenet",
  data_format = "L0",
  data_version = NULL,
  path_cred = NULL,
  export = FALSE,
  last = NULL,
  tz = "Etc/GMT-1",
  use_intl = FALSE
)

Arguments

site

character, specify the site. String is not case sensitive.

sensor_name

character, specify the name of a single or multiple sensors (e.g. "LWF-Demo-1.dendrometer.ch0").

sensor_class

character, specify a single or multiple sensor classes. String does not have to contain the full name of the sensor class, i.e. "dendro" works for "dendrometer". String is not case sensitive.

from

character, optional argument to select data after a specific date ("YYYY-MM-DD").

to

character, optional argument to select data up to a specific date ("YYYY-MM-DD").

bind_df

logical, indicate whether data should be returned as a data.frame (bind_df = TRUE) or as a named list bind_df = FALSE.

server

character, specify server from which data is downloaded. Can be either treenet or decentlab.

data_format

character, select processing level of data. Can either be "L0" (i.e. raw data), "L1" (i.e time-aligned) or "L2" (i.e. processed).

data_version

character, optional argument specifying the package version number. If provided, L2 data generated by the package version specified is downloaded from the server (download of L0 or L1 data is not affected).

path_cred

optional argument to specify the full path to the file config.yml containing the database login data. File can also be copied to the main folder of the package for automatic recognition.

export

logical, indicate whether each sensor will be saved as an .RData-file to the current working directory (export = TRUE) or will be returned to the console.

last

numeric, optional argument to specify the number of latest values. If last is specified from and to need to be empty.

tz

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

use_intl

logical, specify whether this function is used internally on the server. Changes stop() error messages to message() only.

Value

If export = TRUE each sensor is saved as an .RData-file to the current working directory. Else, export = FALSE data will be returned to the console either as a data.frame (bind_df = TRUE), or as a list with each sensor as a list element (bind_df = FALSE).

Examples

1
2
3
4
5
## Not run: 
download_treenet(site = "lens", export = TRUE, bind_df = FALSE,
                 server = "decentlab")

## End(Not run)

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