rem_reps | R Documentation |
Remove replicates in SWMP nutrient data to keep approximate monthly time step
rem_reps(swmpr_in, ...)
## S3 method for class 'swmpr'
rem_reps(swmpr_in, FUN = function(x) mean(x, na.rm = TRUE), ...)
swmpr_in |
input swmpr object |
... |
arguments passed to other methods |
FUN |
function to combine values, defaults to mean |
Raw nutrient data obtained from the CDMO will usually include replicate samples that are taken within a few minutes of each other. This function combines nutrient data that occur on the same day. The datetimestamp
column will always be averaged for replicates, but the actual observations will be combined based on the user-supplied function which defauls to the mean. Other suggested functions include the median
, min
, or max
. The entire function call including treatment of NA
values should be passed to the FUN
argument (see the examples). The function is meant to be used after qaqc
processing, although it works with a warning if QAQC columns are present.
Returns a swmpr object for nutrient data with no replicates.
qaqc
## get nutrient data
data(apacpnut)
swmp1 <- apacpnut
# remove replicate nutrient data
rem_reps(swmp1)
# use different function to aggregate replicates
func <- function(x) max(x, na.rm = TRUE)
rem_reps(swmp1, FUN = func)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.