Description Usage Arguments Details Value Author(s) See Also
This function processes measurements from observation sites in a monitoring network.
1 2 | ProcessObs(observations, parameters, detection.limits = NULL,
date.fmt = "%Y-%m-%d")
|
observations |
data.frame. Observed data records, see ‘Details’ section. |
parameters |
data.frame. Parameter descriptions, see ‘Details’ section. |
detection.limits |
data.frame. Detection limits, see ‘Details’ section. |
date.fmt |
character. Date format used to convert character strings to Date class. |
The observations
, parameters
, and detection.limits
data tables are composed of character-class components.
Required columns in the observations
data table include:
Site_id
, a unique site identifier;
Site_name
, a local site name; and
Date
, the measurement date.
Measured values are checked for an optional character code in the first digit of each character string value.
Character codes are identified using the following criteria:
<, below reporting level;
E, estimated value;
V, contaminated; and
U, undetectable.
Values are stripped of their character code and converted to numeric class.
A warning is given if the character code is not recognized and its value set to NA.
Measured values with character codes of V and U are also set to NA.
Required columns in the parameters
data table include:
Parameter_id
, a unique parameter identifier;
Parameter_name
, the common parameter name;
Units
, the units associated with the measured parameter values; and
sd
, a column name in observations
data table where the parameters standard deviation values are located.
A required column in the detection.limits
data table is Date
,
the date when the detection limit was first implemented.
Detection limit values are located in subsequent columns;
a unique parameter identifier is specified for each of these column names.
A measured value is converted to censored data under the following conditions: (1) the measured value is below the reporting level and represented as left-censored data; or (2) there is a standard deviation and detection limit associated with the measured value, therefore, it is represented as interval-censored data. The upper and lower bounds of interval-censored data are calculated by adding and subtracting three standard deviations from the measured value, respectively. Interval-censored data with a lower or upper bound less than the detection limit is represented as left-censored data. For left-censored data, the upper bound is set to the detection limit when its magnitude is less than the detection limit.
Returns an object of class list with data.frame components corresponding to unique parameter identifiers. Each data table has the following components:
unique site identifier
local site name
observation date
single-digit character code
measured value
standard deviation of the measured value.
detection limit of the measured value.
observation as censored or uncensored data of interval type.
Additional attributes associated with the returned data frame include:
Parameter_id
, unique parameter identifier;
Parameter_name
, parameter name; and
Units
, parameter units.
J.C. Fisher, U.S. Geological Survey, Idaho Water Science Center
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.