sfn_get_methods: sfn_data get methods

sfn_get_methodsR Documentation

sfn_data get methods

Description

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

Usage

## 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

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 Feb. 16, 2023, 7:52 p.m.