Learn R Programming

SpatioTemporal (version 0.9.2)

plotMonitoringLoc: Plot of Observation Locations and Dates

Description

Plots observation locations (or values) against the date of each observation.

Usage

plotMonitoringLoc(mesa.data, main = "", col = NULL, legend.loc =
                  "topleft", legend.names = NULL, add = FALSE,
                  obsplot=FALSE, pch=19, cex=.1, ...)

Arguments

mesa.data
Data structure holding observations, as well as observation locations and dates of observations. See mesa.data and mesa.data.model.
main
A character string to be used as the main title of the plot.
col
A vector containing the colors to be used for each monitoring type in the plot.
legend.loc
The location of the legend. See legend.
legend.names
A vector of character strings to be used in the legend.
add
If TRUE adds to an existing plot.
obsplot
If TRUE the function will plot a time trend of all raw observations, color-coded by type. Otherwise (default), location ID is plotted on the y-axis.
cex, pch
Parameters controlling the plotting symbol; passed on to points. Default is a small filled circle.
...
Additional parameters passed to either plot or points, depending on the value of add.

Value

  • Does not return anything.

encoding

latin1

Details

This function creates a plot where each of the monitoring locations (or observations if obsplot=TRUE) are on the vertical axis, and each of the observation dates are on the horizontal axis. If obsplot=TRUE, the y-axis will show the raw observations instead of location ID, and the plot will be a composite time-trend of all observations (potentially) color coded by type.

If mesa.data$location$type contains location types, the monitoring locations are colour-coded by type; if mesa.data does not contain monitoring types, a single type for all locations is assumed. The colours to use are specified in col. By default the function uses 1:n, where n is the number of unique monitoring types. and col must be length 1.

The vector legend.names should have length equal to the number of unique location types. The default legend names are the unique values found in mesa.data$location$type, see mesa.data. If mesa.data$location does not contain location types, legend.names must be of length 1 and the defaults to "Observations".

See Also

plotMesaData, printMesaDataNbrObs for further data summaries.

Examples

Run this code
##load data
data(mesa.data)

##standard plot
plotMonitoringLoc(mesa.data)

##different names/colours/etc
plotMonitoringLoc(mesa.data, main="A nice plot", col=c("green","blue"),
    legend.names=c("Sites of one type", "..and of the other"),
    legend.loc="bottomleft")

##composite time-trend
plotMonitoringLoc(mesa.data, obsplot=TRUE)

Run the code above in your browser using DataLab