Learn R Programming

sapfluxnetr (version 0.1.5)

sfn_replacement_methods: sfn_data replacement methods

Description

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

Usage

# S4 method for sfn_data
get_sapf_data(object) <- value

# S4 method for sfn_data get_env_data(object) <- value

# S4 method for sfn_data get_sapf_flags(object) <- value

# S4 method for sfn_data get_env_flags(object) <- value

# S4 method for sfn_data get_timestamp(object) <- value

# S4 method for sfn_data get_solar_timestamp(object) <- value

# S4 method for sfn_data get_si_code(object) <- value

# S4 method for sfn_data get_site_md(object) <- value

# S4 method for sfn_data get_stand_md(object) <- value

# S4 method for sfn_data get_species_md(object) <- value

# S4 method for sfn_data get_plant_md(object) <- value

# S4 method for sfn_data get_env_md(object) <- value

Arguments

object

sfn_data containing the slot to replace

value

object with the data to replace sfn_data slot with

Details

The replacement object must be a valid object for that slot:

  • For get_sapf_data, get_env_data, get_sapf_flags and get_env_flags a data.frame or tibble without the TIMESTAMP variable

  • For get_*_md a data.frame or tibble

  • For get_timestamp and get_solar_timestamp a POSIXct vector of length == nrow(sapf/env_data)

  • For get_si_code a character vector

Validity is automatically checked before modifying the sfn_data object, and an error is raised if not valid

Examples

Run this code
# preparation
data('ARG_TRE', package = 'sapfluxnetr')
sapf_data <- get_sapf_data(ARG_TRE, solar = TRUE)

# modifying the slot data
sapf_data[1:10, 2] <- NA

# replacement. Remember, the sfn_data slot does not contain a TIMESTAMP
# variable, it must be removed
get_sapf_data(ARG_TRE) <- sapf_data[,-1]

Run the code above in your browser using DataLab