nonparTrends: nonparTrends

nonparTrendsR Documentation

nonparTrends

Description

Uses non-parametric methods to test for trends in water quality data across years for each month. This function assumes that the data are composed of monthly observations that are correlated within a year. Note that this function is only appropriate for trends that are one-directional and requires at least 6 datapoints within a given month to test for trends.

Usage

nonparTrends(
  object,
  parkcode = NA,
  sitecode = NA,
  charname = NA,
  category = NA,
  info = NA,
  censored = FALSE,
  ...
)

Arguments

object

A Park object or a data.frame such as that produced by getWData.

charname

Name, in quotes, of a single Characteristic whose data should be analyzed. Either this or category is required.

category

Name, in quotes of a single category of characteristics whose data should be analyzed. Either this or charname is required.

censored

Either TRUE or FALSE. If FALSE (default), function runs the openair::TheilSen test with deseason = TRUE. If TRUE, function runs a separate NADA::cenken test for for each month in the dataset.

...

Additional commands passed to getWData for filtering or subsetting the data.

Value

The results of a Theil-Sen analysis for censored or non-censored data with a row for month in the analysis and a column for the month, slope, intercept and p-value (pval) from each test.

Examples

waterobj <- importNCRNWater(Dir = "./Data/",
                            Data = "Water Data.csv",
                            MetaData = "VizMetaData.csv")
trends<- nonparTrends(waterobj, parkcode = "ACAD", sitecode = "NETN_ACAD_LONG", charname = "pH", censored = FALSE)
trends_cen<- nonparTrends(waterobj, parkcode = "ACAD", sitecode = "NETN_ACAD_LONG", charname = "NO2+NO3_mgL", censored = TRUE)


NCRN/NCRNWater documentation built on May 15, 2023, 9:50 p.m.