Learn R Programming

wq (version 0.4.3)

WqData-class: Class "WqData"

Description

A simple extension or subclass of the "data.frame" class for typical discrete water quality monitoring programs that examine phenomena on a time scale of days or longer. It requires water quality data to be in a specific long format, although a generating function wqData can be used for different forms of data.

Arguments

Rdversion

1.1

docType

class

Objects from the Class

Objects can be created by calls of the form new("WqData", d), where d is a data.frame. d should have columns named time, site, depth, variable, value of class "DateTime", "factor", "numeric", "factor", "numeric", respectively.

Extends

Class "data.frame", directly. Class "list", by class "data.frame", distance 2. Class "oldClass", by class "data.frame", distance 2. Class "vector", by class "data.frame", distance 3.

See Also

DateTime-class, tsMake,WqData-method, wqData

Examples

Run this code
showClass("WqData")
# Construct the WqData object sfb as shown in the wqData examples.
sfb <- wqData(sfbay, c(1,3,4), 5:12, site.order = TRUE, type = "wide", 
              time.format = "%m/%d/%Y")
# Summarize the data
summary(sfb)
# Create boxplot summary of data
plot(sfb, vars = c('chl', 'dox', 'spm'), num.col = 2)
# Extract some of the data as a WqData object
sfb[1:10,]  # first 10 observations
sfb[sfb$depth==20,]  # all observations at 20 m

Run the code above in your browser using DataLab