Learn R Programming

neonSoilFlux

neonSoilFlux is a repository code to acquire, tidy, and compute soil respiration fluxes at NEON sites using the flux-gradient method.

An online applet for visualization at select NEON sites is found here

Installation

Installation in R through:

  • CRAN: install.packages(neonSoilFlux)
  • Github using the devtools package:

devtools::install_github("jmzobitz/neonSoilFlux", build = TRUE, build_opts = c("--no-resave-data", "--no-manual"),force=TRUE)

If you encounter problems with code in this repository, feel free to post an issue.

Usage

To analyze fluxes once the package is installed requires a two step process:

  1. Load up the tidyverse and lubridate libraries (library(tidyverse) and library(lubridate). We are heavily making use of dplyr and purrr, so this should get you covered.

  2. First acquire the NEON data, following conventions of loadByProduct function in the neonUtilities package.

out_env_data <- acquire_neon_data(site_name = 'SJER', download_date = '2022-06', )

  1. Then process and compute fluxes.

out_fluxes <- compute_neon_flux(input_site_env = out_env_data$site_data, input_site_megapit = out_env_data$site_megapit )

You now have a data frame of computed fluxes.

More detailed usage information is given in the vignette using-neonSoilFlux (vignette(using-neonSoilFlux)).

Credits & Acknowledgements

The package neonSoilFlux was funded with support from the National Science Foundation, grant #2017829. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation.

The National Ecological Observatory Network is a program sponsored by the National Science Foundation and operated under cooperative agreement by Battelle. This material is based in part upon work supported by the National Science Foundation through the NEON Program.

Code Contributions / Changelog:

  • (pre-2021): Initial code developed by Edward Ayres (eayres@battelleecology.org)
  • 2021: Initial package development and testing by Zobitz and undergraduate researchers Lajntxiag Lee and Kathleen O'Rourke (both Augsburg University)
  • 2022: Ongoing refinement and testing by undergraduate researchers at the following institutions:
    • Ridwan Abdi, Kebba Janeh, Nevin Lor, Diana Ortiz Alvarracin, Dijone Mehmeti, Ali Musa, Barbara Sabino Pina, Ly Xiong, Xeng Yang (Augsburg University)
    • Courtney Leung (Northwestern University)
  • 2024: Refinement to include a gapfilling routine from Zoey Werbin at Boston University as well as additional calculations of the soil flux via different approaches in Maier, M., and H. Schack-Kirchner. 2014. “Using the Gradient Method to Determine Soil Gas Flux: A Review.” Agricultural and Forest Meteorology 192–193 (July): 78–95. https://doi.org/10.1016/j.agrformet.2014.03.006.
  • 05.2024 Renaming of pacakge to neonSoilFlux from NEONSoils and associated updates to prepare for CRAN submission.
  • 11.2025 Update to improve efficiency and to coincide with publications of neonSoilFlux: An R Package for Continuous Sensor-Based Estimation of Soil CO2 Fluxes, published in Methods in Ecology and Evolution

License

GNU Affero General Public License Version 3, 19 November 2007

Disclaimer

Information and documents contained within this repository are available as-is. Codes or documents, or their use, may not be supported or maintained under any program or service and may not be compatible with data currently available from the NEON Data Portal.

Copy Link

Version

Install

install.packages('neonSoilFlux')

Monthly Downloads

395

Version

3.0.0

License

GPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

John Zobitz

Last Published

November 22nd, 2025

Functions in neonSoilFlux (3.0.0)

determine_position

Internal function to determine the depth of a measurement
neonSoilFlux-package

neonSoilFlux: Compute Soil Carbon Fluxes for the National Ecological Observatory Network Sites
powerset

Compute all possible combinations of a vector - ignoring the empty set
measurement_detect

Internal function that makes sure for each time, position, and depth we have at least two data points for soil temp and soil h20, 3 for soil co2
measurement_merge

Internal function that filters environmental data for easier processing of fluxes.
tang_2003_flux

Internal function to compute surface co2 flux at a given timepoint via Tang et al 2003
quadrature_error

Helper function to quickly compute the quadrature error
sjer_megapit_data_2022_06

Measured soil physical properties at a NEON site
sjer_env_data_2022_06

Measured environmental data at a NEON site
swc_correct

Internal function to correct depths for VSWC NEON data.
reprocess_vswc

Internal helper function to reprocess SWC data from calibration data
swc_corrections

Corrected sensor locations for NEON soil water content data
sjer_flux_2022_06

Computed flux values at a NEON site
tang_2005_flux

Internal function to compute surface co2 flux at a given timepoint via Tang et al 2005
neonBoulded60Cal

Soil water content calibrations for belowground sensor data
neonCal

Soil water content calibrations for belowground sensor data
compute_neon_flux

Compute NEON fluxes at a site
fit_function

Internal function that interpolates a soil measurement to different depths
flux_fingerprint_plot

Helper function to plot QF results for fluxes.
compute_monthly_mean

Function to compute monthly means for a given month of NEON data.
compute_surface_flux

Internal function to compute CO2 surface flux
compute_flux_gradient_layer

Computes Fick's law of diffusion between two values
acquire_neon_data

Acquire NEON data for processing
compute_surface_flux_layer

Title Determine the surface flux from linear regression at layers
dejong_shappert_flux

Internal function to compute surface co2 flux at a given timepoint via De Jong and Schappert (1972)
co2_to_umol

Convert co2 concentration from ppm to µmol m-3 units
check_qf_flags

Internal helper function to determine availability of data within a time interval
correct_env_data

Internal function that prepares downloaded NEON data for flux processing
env_fingerprint_plot

Helper function to plot QF results for environmental measurements.
diffusivity

Compute soil diffusivity
hirano_flux

Internal function to compute surface co2 flux at a given timepoint via Hirano et al 2005
linear_regression

Compute linear regression coefficients and errors.
inside_interval

Determine if a YYYY-MM string is inside a interval
depth_interpolate

Internal function to interpolate different depth measurements
insert_mean

Internal function that inserts smoothed mean value of a measurement at a site