strata: Data structure to hold strata information.

Description Usage Format Slots Examples

Description

In addition to storing information on the stratums and load, a number of functions are associated with the data structure.

Usage

1

Format

An object of class R6ClassGenerator of length 24.

Slots

all_valid

returns TRUE if all underlying stratums contain sufficient concentration data

calc_stats

loops over the underlying stratums to calculate stats for entire period

rearrange_stratums

accepts a list of partition dates; moves partitions and recalculates stratum statistics

calc_loads

loops over underlying stratums and calculates the load in each

update_rmse

accepts new partitioning scheme, calculates the load, and returns the rmse

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# create new strata object with 3 stratums
number_of_stratums <- 3
mystrata <- strata$new( number_of_stratums, qcdata )

# create partitions to divide year into 3 roughly equal chunks (Jan-Apr, May-Aug, Sep-Dec)
mypartitions <- c( as.Date("1997-04-30"), as.Date("1997-08-31") )

# make call to rearrange stratum boundaries
# NOTE: this also copies the appropriate discharge and concentration data
#       into each stratum
mystrata$rearrange_stratums( mypartitions )

# now calculate loads for each stratum and for the strata overall
mystrata$calc_loads()

smwesten-usgs/autobeale-R documentation built on May 30, 2019, 5:04 a.m.