minObs | R Documentation |
Tests values in a CRHMr obs data frame to see if they exceed minimum
thresholds. Values exceeding the thresholds can be set to either the minimum allowable
value or to NA_real
, which is useful for infilling or imputing values.
minObs(
obs,
varcols = "",
minvals = "",
actions = "min",
quiet = TRUE,
logfile = ""
)
obs |
Required. The CRHMr obs data frame. |
varcols |
Optional. A vector containing the columns to be imputed in the obs data frame, not including the datetime. If not specified, defaults to all columns. |
minvals |
Optional. A vector containing the minimum permissible values for each of the specified columns. If omitted, the default values are used. |
actions |
Optional. A vector containing the methods to be used for replacing values
that exceed the minimum threshold values. Currently supported actions are min
(using the threshold) and NA (using |
quiet |
Optional. Suppresses display of messages, except for errors. If you are
calling this function in an R script, you will usually leave |
logfile |
Optional. Name of the file to be used for logging the action. Normally not used. |
If successful, returns a modified version of the obs data frame. The values
smaller than the specified min
values are replaced by either NA_real_
or the threshold min
values. If unsuccessful, returns an error.
The default threshold values are
t | -40 C |
ea | 0.01 kPa |
rh | 0.5 percent |
ppt | 0 mm |
p | 0 mm |
u | 0 m/s |
SunAct | 0 hr |
qsi | 0 W/m^2 |
qso | 0 W/m^2 |
qn | -60 W/m^2 |
Kevin Shook
maxObs
# use all of the default values
bad.min <- minObs(BadLake7376)
# use specified columns with default min values, replace with 'NA' values
bad.min2 <- minObs(BadLake7376, varcols = c(1, 2), actions = "NA")
# use specfied columns with specified min values and actions
bad.min3 <- minObs(BadLake7376, minvals = c(-30, 22), varcols = c(1, 2), actions = c("min", "NA"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.