Learn R Programming

mesonet (version 0.0.2)

mnet_calc_vwc: Calculate soil volumteric water content for Oklahoma Mesonet data

Description

Calculate soil volumetric water content from delta-T soil temperature change data from the Oklahoma Mesonet using mnet_calc_mp to calculate matric potential and mnet_van_genuchten to calculate the corresponding volumetric water content using parameters provided by mnet_site_info.

Usage

mnet_calc_vwc(data, site_info = NULL)

Value

a data frame containing new columns with volumetric water content for each column of delta-T temperature change data.

Arguments

data

a data frame that contains a column of Mesonet station identifier codes (i.e. STID) and columns for delta-T temperature change data (i.e. TR05, TR25, TR60, TR75)

site_info

a data frame with site and soil information for each Oklahoma Mesonet station as returned by mnet_site_info. If NULL, mnet_site_info will be used to download this information internally

Examples

Run this code

# \dontshow{
  mesonet_cache_dir <- mnet_test_cache(site_info = TRUE)
  previous_options <- options(.mesonet_cache = mesonet_cache_dir)
# }

# Create example dataset
mesonet_data <- data.frame(STID = "ACME", DATE = as.POSIXct("2025-01-01"),
                           TR05 = 3.17, TR25 = 2.17, TR60 = 2.0, TR75 = 1.0)

mnet_calc_vwc(mesonet_data)

# \dontshow{
  unlink(mesonet_cache_dir, recursive = TRUE)
  options(previous_options)
# }

Run the code above in your browser using DataLab