Adding this method on 31 May 2020, hoping this style will depreciate getErrorTable in the future.

# S4 method for redoxSensor
ranges_df(
  object,
  inaccuracies = c(0.02),
  Emin = -400,
  Emax = -200,
  temp = 295.15,
  by = 0.01,
  name = "Sensor",
  thresholds = c(0.5, 1, 1.5, 2, 2.5)
)

Arguments

object

A redoxSensor object

inaccuracies

(optional, default: c(0.02)) A vector of inaccuracies (e.g. 0.02 for 2% error), always relative

Emin

(optional, default: -400) The minimum redox potential, in mV, for which to record error

Emax

(optional, default: -200) The maximum redox potential, in mV, for which to record error

temp

(optional, default: 295.15) the temperature (in Kelvin) at which measurements were made

by

(optional, default: 0.01) The granularity of the error table--e.g., by = 0.01 would record 275 and 275.01, etc.

name

(optional, default: "Sensor") A name for this sensor

thresholds

A vector of error thresholds (e.g. c(0.5, 1) for 0.5mV and 1mV)

Value

A dataframe of suited ranges with these columns: 'Sensor_Name': the name of the sensor 'Minimum': the minimum redox potential (mV) measurable at the given inaccuracy 'Maximum': the maximum redox potential (mV) measurable at the given inaccuracy 'Inaccuracy': the inaccuracy associated with this row (relative) 'error_thresh': the error threshold associated with this row (mV)

Examples

my_sensor <- new("redoxSensor", new("Sensor", Rmin = 1, Rmax = 5, delta = 0.2), e0 = -250) ranges_df(my_sensor)
#> Sensor_Name Minimum Maximum Inaccuracy error_thresh #> 1 Sensor_0.02 NA NA 0.02 0.5 #> 2 Sensor_0.02 -256.99 -222.08 0.02 1.0 #> 3 Sensor_0.02 -264.86 -214.32 0.02 1.5 #> 4 Sensor_0.02 -269.44 -209.77 0.02 2.0 #> 5 Sensor_0.02 -272.67 -206.56 0.02 2.5