Learn R Programming

aqp (version 2.1.0)

ph_to_rxnclass: Convert pH to/from Reaction Classes

Description

Convert pH to/from Reaction Classes

Usage

ph_to_rxnclass(x, halfclass = FALSE, as.is = FALSE, droplevels = TRUE)

rxnclass_to_ph(x, halfclass = FALSE, digits = 2, simplify = TRUE)

ReactionClassLevels(halfclass = FALSE, as.is = FALSE)

Value

ph_to_rxnclass(): a vector of reaction classes corresponding to numeric input in x; if as.is=FALSE an ordered factor using ReactionClassLevels()

rxnclass_to_ph(): a list of data.frame objects containing high/low values of reaction class 1:1 with input; if simplify=TRUE and input is a data.frame.

ReactionClassLevels(): ordered factor containing descriptive terms for reaction classes

Arguments

x

input pH values (numeric; ph_to_rxnclass()) or reaction classes (character; rxnclass_to_ph())

halfclass

Split the standard classes in half for higher resolution? Default: FALSE

as.is

logical. Should character vectors be converted to factors? Default: FALSE

droplevels

logical. Drop unused levels in factors? Default: FALSE

digits

Number of digits after decimal place; Default: 2. Used only for rxnclass_to_ph()

simplify

Simplify list result to numeric vector when length of result is 1? Default: TRUE

Examples

Run this code
ph_to_rxnclass(6.2)
rxnclass_to_ph("slightly acid")

rxnclass_to_ph(list(c("Slightly Acid", NA, "Moderately Acid"),
                    c("Slightly Acid", NA, "Strongly Acid")), simplify = FALSE)
ReactionClassLevels()

Run the code above in your browser using DataLab