sfn_get_methods: sfn_data get methods

Description Usage Arguments Details Examples

Description

Methods to get the data and metadata from the sfn_data class slots

Usage

 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
## S4 method for signature 'sfn_data'
get_sapf_data(object, solar = FALSE)

## S4 method for signature 'sfn_data'
get_env_data(object, solar = FALSE)

## S4 method for signature 'sfn_data'
get_sapf_flags(object, solar = FALSE)

## S4 method for signature 'sfn_data'
get_env_flags(object, solar = FALSE)

## S4 method for signature 'sfn_data'
get_timestamp(object)

## S4 method for signature 'sfn_data'
get_solar_timestamp(object)

## S4 method for signature 'sfn_data'
get_si_code(object)

## S4 method for signature 'sfn_data'
get_site_md(object)

## S4 method for signature 'sfn_data'
get_stand_md(object)

## S4 method for signature 'sfn_data'
get_species_md(object)

## S4 method for signature 'sfn_data'
get_plant_md(object)

## S4 method for signature 'sfn_data'
get_env_md(object)

Arguments

object

Object of class sfn_data from which data is retrieved

solar

Logical indicating if the timestamp to return in the get_sapf_data, get_env_data, get_sapf_flags and get_env_flags methods is the solarTIMESTAMP (TRUE) or the contributors provided TIMESTAMP (FALSE)

Details

get_sapf_data and get_env_data methods retrieve sapflow or environmental tibbles to create a functional dataset to work with.

get_sapf_flags and get_env_flags methods retrieve sapflow or environmental flags as tibbles.

get_timestamp and get_solar_timestamp methods retrieve only the timestamp as POSIXct vector.

get_si_code method retrieve a character vector with length(timestamp) containing the site code.

get_site_md, get_stand_md, get_species_md, get_plant_md and get_env_md methods retrieve the corresponding metadata.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
library(dplyr)

data('ARG_TRE', package = 'sapfluxnetr')
sapf_data <- get_sapf_data(ARG_TRE, solar = TRUE)
env_data_no_solar <- get_env_data(ARG_TRE, solar = FALSE)
plant_md <- get_plant_md(ARG_TRE)

# dplyr pipe to get the mean dbh for a site
ARG_TRE %>%
  get_plant_md() %>%
  summarise(dbh_mean = mean(pl_dbh, na.rm = TRUE)) %>%
  pull(dbh_mean)

sapfluxnetr documentation built on Aug. 28, 2020, 1:13 a.m.