calibration_matrix: Load or manipulate calibration matrices

View source: R/calibrations.R

calibration_matrixR Documentation

Load or manipulate calibration matrices

Description

Load or manipulate calibration matrices

Usage

calibration_matrix(tbl, sta4, typ = c("free", "cdr", "cd"), ...)

## S3 method for class 'cal.pbo'
calibration_matrix(tbl, sta4, typ = c("free", "cdr", "cd"), ...)

## S3 method for class 'cal.pboiso'
calibration_matrix(tbl, sta4, typ = c("free", "cdr", "cd"), ...)

## S3 method for class 'cal.hodg'
calibration_matrix(tbl, sta4, typ = NULL, ...)

## S3 method for class 'cal.roel'
calibration_matrix(tbl, sta4, typ = NULL, ...)

fortify_calibration_matrix(
  Sij,
  sta4 = NA,
  typ = NA,
  needs.pinv = FALSE,
  byrow = TRUE,
  ...
)

all_calibrations(tbl, sta4, ...)

## S3 method for class 'cal.hodg'
all_calibrations(tbl, sta4, ...)

## S3 method for class 'cal.pbo'
all_calibrations(tbl, sta4, ...)

## S3 method for class 'cal.pboiso'
all_calibrations(tbl, sta4, ...)

any_calibration(tbl, sta4, preference, ...)

## Default S3 method:
any_calibration(tbl, sta4, preference = c("free", "cdr", "cd"), ...)

## S3 method for class 'cal.hodg'
any_calibration(tbl, sta4, preference = c("free", "cdr", "cd"), ...)

## S3 method for class 'cal.pbo'
any_calibration(tbl, sta4, preference = c("free", "cdr", "cd"), ...)

## S3 method for class 'cal.pboiso'
any_calibration(tbl, sta4, preference = c("free", "cdr", "cd"), ...)

Arguments

tbl

character; the name of the table to load; defaults to "pbo" if missing. The function will dispatch the appropriate method depending on the class of the object

sta4

character; the four-character station code, e.g. 'B084'

typ

character; an optional method identifier

...

additional arguments

Sij

matrix, or an object to be coerced into a matrix

needs.pinv

logical; indicate whether the matrix should be pseudo-inverted

byrow

logical; if Sij needs to be coerced into a matrix, should it be filled ‘byrow’?

preference

character; a vector of preferred calibration types (decreasing in preference with increasing index number); the first valid calibration matrix is returned based on this preference

Author(s)

A. Barbour

See Also

pinv to calculate the pseudoinverse

station_data to find information about the PBO stations (including sta4)

Other Calibrations: describe_this(), get_caltbl()

Examples

## Not run: 
#
# select a calibration table
#  data(bsmCalibrations)
#  pbotbl <- bsmCalibrations[['pbo']]
#  describe_this(pbotbl)
# or simply
pbotbl <- get_caltbl("pbo")
# 
# indiviual tables
calibration_matrix(pbotbl, "B084")
calibration_matrix(pbotbl, "B082") # Full of NAs (no calib.)
#
# All of the available calibrations (note the loss of attributes)
all_calibrations(pbotbl, "B084") # all three are available
all_calibrations(pbotbl, "B082") # but there's at least one
#
# First available calibration
any_calibration(pbotbl, "B084")
#

## End(Not run)

abarbour/pborepo documentation built on April 27, 2022, 8:47 a.m.