compute_neon_flux: Compute NEON fluxes at a site

View source: R/compute_neon_flux.R

compute_neon_fluxR Documentation

Compute NEON fluxes at a site

Description

Given a site filename (from acquire_neon_data), process and compute fluxes. This file takes a saved data file from acquire: 1) Takes the needed components (QF and measurement flags) for soil water, temperature, co2, binding them together in a tidy data frame 2) Interpolates across the measurements 3) Merges air pressure data into this data frame 4) Does a final QF check so we should have only timeperiods where all measurements exist 5) Adds in the megapit data so we have bulk density, porosity measurements at the interpolated depth. 6) Saves the data

Usage

compute_neon_flux(input_site_env, input_site_megapit)

Arguments

input_site_env

Required. Input list of environmental data. Usually given from acquire_neon_data

input_site_megapit

Required. Input list of environmental soil data. Usually given from acquire_neon_data

Value

Data frame of fluxes and gradient from the timeperiod

Author(s)

John Zobitz zobitz@augsburg.edu based on code developed by Edward Ayres eayres@battelleecology.org

Examples


# Test to see if you have a NEON API token installed
# in your local environment.
# Supply a token directly - what will be returned is the
# input.
# get_neon_api_token("example_token")

# Or retrieve NEON stored in the environment
# if (nzchar(Sys.getenv("NEON_TOKEN"))) {
#  get_neon_api_token()
# }
# If no token exists, then see documentation for neonSoilFlux::neon_api_token()
# Downloading data is through the function neonSoilFlux::acquire_neon_data().
# This example uses an existing dataset from SJER in 2022-06
# bundled with the package, from this code:
# out_env_data <- acquire_neon_data(
# site_name = 'SJER',
# download_date = '2022-06'
# )
# sjer_env_data_2022_06 <- out_env_data$site_data
# sjer_megapit_data_2022_06 <- out_env_data$site_megapit

# Then process and compute the fluxes:
 out_flux <- compute_neon_flux(
 input_site_env = sjer_env_data_2022_06,
 input_site_megapit = sjer_megapit_data_2022_06
 )


neonSoilFlux documentation built on July 3, 2026, 5:07 p.m.