rem_reps: Remove replicates in nutrient data

Description Usage Arguments Details Value See Also Examples

View source: R/swmpr_organize.R

Description

Remove replicates in SWMP nutrient data to keep approximate monthly time step

Usage

1
2
3
4
5
rem_reps(swmpr_in, ...)

## S3 method for class 'swmpr'
rem_reps(swmpr_in, FUN = function(x) mean(x, na.rm = TRUE),
  ...)

Arguments

swmpr_in

input swmpr object

...

arguments passed to other methods

FUN

function to combine values, defaults to mean

Details

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.

Value

Returns a swmpr object for nutrient data with no replicates.

See Also

qaqc

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## 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)

SWMPr documentation built on Feb. 9, 2018, 6:08 a.m.