boxplot.SpatialStreamNetwork: Box-and-whisker plots for data within SpatialStreamNetwork...

View source: R/boxplot.SpatialStreamNetwork.R

boxplot.SpatialStreamNetworkR Documentation

Box-and-whisker plots for data within SpatialStreamNetwork objects.

Description

The boxplot function creates box-and-whisker plots for data within SpatialStreamNetwork-classobjects.

Usage

## S3 method for class 'SpatialStreamNetwork'
boxplot(x, variable, ...)

Arguments

x

an object of class SpatialStreamNetwork-class

variable

the variable (in quotes) for which the boxplots are being created, or a formula, such as y ~ grp, where y is a numeric vector of data values and grp is a grouping of variables (usually a factor).

...

see boxplot for additional arguments

Details

boxplot is a generic function that has been adapted for SpatialStreamNetwork-classobjects. Use names to get a list of the variable names within the SpatialStreamNetwork object; the boxplot boxplot will only work for the observed data set.

Value

A graph is produced, and a list with the following components:

stats

a matrix, each column contains the extreme of the lower whisker, the lower hinge, the median, the upper hinge and the extreme of the upper whisker for each group/plot. If all the inputs have the same class attribute, then so will this component.

n

a vector with the number of observations in each group.

conf

a matrix where each column contains the lower and upper extremes of the notch.

out

the values of any data points which lie beyond the extremes of the whiskers.

group

a vector of the same length as out whose elements indicate to which group the outlier belongs.

names

a vector of names for the groups

Author(s)

Jay Ver Hoef support@SpatialStreamNetworks.com

References

see boxplot

See Also

boxplot.stats

Examples


library(SSN)
#for examples, copy MiddleFork04.ssn directory to R's temporary directory
copyLSN2temp()
# NOT RUN
# Create a SpatialStreamNetork object that also contains prediction sites
#mf04 <- importSSN(paste0(tempdir(),'/MiddleFork04.ssn'), 
#  predpts = "pred1km", o.write = TRUE)
#use mf04 SpatialStreamNetwork object, already created
data(mf04)
#for examples only, make sure mf04p has the correct path
#if you use importSSN(), path will be correct
mf04 <- updatePath(mf04, paste0(tempdir(),'/MiddleFork04.ssn'))

boxplot(mf04, "Summer_mn")
boxplot(mf04, Summer_mn ~ STREAMNAME, main = "Summer_mn ~ STREAMNAME", 
      col = "gray", xlab = "STREAMNAME", ylab = "Summer Mean Temperature")


SSN documentation built on March 7, 2023, 5:30 p.m.