sw_upgrade: Upgrade a 'rSOILWAT2'-classed object from an older package...

sw_upgradeR Documentation

Upgrade a rSOILWAT2-classed object from an older package version

Description

Missing slots and elements are added and take the new default values from SOILWAT2.

Usage

sw_upgrade(object, verbose = FALSE)

## S4 method for signature 'ANY'
sw_upgrade(object, verbose = FALSE)

## S4 method for signature 'swFiles'
sw_upgrade(object, verbose = FALSE)

## S4 method for signature 'swMonthlyScalingParams'
sw_upgrade(object, verbose = FALSE)

## S4 method for signature 'swWeather'
sw_upgrade(object, verbose = FALSE)

upgrade_weatherDF(
  weatherDF,
  template_weatherColumns = c("Year", "DOY", weather_dataColumns())
)

upgrade_weatherHistory(object, verbose = FALSE)

## S4 method for signature 'swProd'
sw_upgrade(object, verbose = FALSE)

## S4 method for signature 'swSite'
sw_upgrade(object, verbose = FALSE)

## S4 method for signature 'swSoils'
sw_upgrade(object, verbose = FALSE)

## S4 method for signature 'swOUT'
sw_upgrade(object, verbose = FALSE)

## S4 method for signature 'swEstabSpecies'
sw_upgrade(object, verbose = FALSE)

## S4 method for signature 'swEstab'
sw_upgrade(object, verbose = FALSE)

## S4 method for signature 'swInputData'
sw_upgrade(object, verbose = FALSE)

Arguments

object

An object of a rSOILWAT2 class.

verbose

A logical value.

weatherDF

A data frame with weather variables.

template_weatherColumns

A vector with requested weather variables.

Value

The upgraded object, if needed, to match the current version with missing slots and elements filled with default values.

For upgrade_weatherDF(): an updated weatherDF with requested columns.

Details

List of changes:

  • Changes with v6.0.0:

    • class swSite: new slots "swrc_flags", "has_swrcp", and "SoilDensityInputType"

    • class swSoils: new slot "SWRCp"

    • class swFiles: SWRC parameter input file added as file 6 for a new total of 23

    • class swProd: new slot "veg_method"

  • Changes with v5.4.0:

    • classes swEstabSpecies and swEstab: new slot "vegType"

  • Changes with v5.2.0:

    • class swOUT: "FROZEN" added as outkey 28 for a new total of 32

  • Changes with v3.1.0:

    • class swOUT: "BIOMASS" added as outkey 31 for a new total of 31

  • Changes with v2.3.0:

    • class swOUT: "SWA" added as outkey 8 for a new total of 30

Examples

x <- sw_upgrade(rSOILWAT2::sw_exampleData, verbose = TRUE)

upgrade_weatherDF(
  data.frame(DOY = 1:2, Tmax_C = runif(2), dummy = runif(2))
)


Burke-Lauenroth-Lab/Rsoilwat documentation built on Dec. 9, 2023, 12:41 a.m.