Description Usage Arguments Details Value Author(s) See Also Examples
plot
method for class STdata
or
STmodel
. Provides several different plots of the data.
When calles for STmodel
, STmodel$locations
acts as
STdata$covars
.
1 2 3 4 5 6 7 8 9 | ## S3 method for class 'STdata'
plot(x, y = c("obs", "res", "acf", "pacf", "loc", "loc.obs"),
ID = x$covars$ID[1], type = x$covars$type, col = NULL, pch = NULL,
cex = NULL, lty = NULL, legend.loc = "topleft", legend.names = NULL,
add = FALSE, ...)
## S3 method for class 'STmodel'
plot(x, y = "obs", ID = x$locations$ID[1],
type = x$locations$type, ...)
|
x |
|
y |
Type of plot, options are |
ID |
The location for which we want to plot observations. Either a
string matching the names in |
type |
Factorial of |
col, pch, cex, lty |
Colour, type of points, size of points, and type of
lines. Exact meaning depends on value of |
legend.loc |
The location of the legend, for |
legend.names |
A vector of character strings to be used in the legend,
for |
add |
Add to existing plot, only relevant if |
... |
Additional parameters passed to |
Performs a variety of different plots determined by y
:
Plot observations for location ID
, along with the
fitted temporal trend.
Plot residuals for the fitted temporal trend at location
ID
; adds the y=0
line for reference.
Plot autocorrelation function for the residuals from the
fitted temporal trend at location ID
.
Plot partial autocorrelation function for the residuals
from the fitted temporal trend at location ID
.
Plot the observation location index number as a function
of the observation date, for all observations. Possibly coded by the
type
of observations locations.
Plot the observation value as a function
of the observation date, for all observations. Possibly coded by the
type
of observations locations.
For y=c("obs","res")
the first element of col,pch,cex,lty
is
used to specify plotting of the observations, and the second element is used
to specify plotting of the fitted temporal trend, or 0-line for
"res"
. Defaults: col=1
, pch=c(1,NA)
, cex=1
,
lty=c(NA,1)
. Elements of length one are repeated.
For y=c("acf","pacf")
col,pch,cex,lty
are ignored.
For y=c("loc","loc.obs")
col,pch,cex
are used to specify the
points for each of the different levels in type
and should be of
length 1 or length(levels(type))
. lty
is ignored.
Default: col=1:length(levels(type))
, pch=19
, cex=.1
For y=c("loc","loc.obs")
a legend is added if legend.loc!=NULL
.
The vector legend.names
should have length equal to the number of
unique location types. The default legend names are levels(type)
.
Nothing
Johan Lindstrom and Assaf P. Oron
Other STdata methods: createSTdata
,
print.STdata
,
print.summary.STdata
,
qqnorm.predCVSTmodel
,
scatterPlot.predCVSTmodel
,
summary.STdata
Other STmodel methods: MCMC.STmodel
,
c.STmodel
, createSTmodel
,
estimate.STmodel
,
estimateCV.STmodel
,
predict.STmodel
,
print.STmodel
,
print.summary.STmodel
,
qqnorm.predCVSTmodel
,
scatterPlot.predCVSTmodel
,
simulate.STmodel
,
summary.STmodel
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | ##load data
data(mesa.model)
##default plot
plot(mesa.model)
##plot monitor locations
plot(mesa.model, "loc")
##different names/colours/etc
plot(mesa.model, "loc", main="A nice plot", col=c("green","blue"),
legend.names=c("Sites of one type", "..and of the other"),
legend.loc="topleft")
##composite time-trend
plot(mesa.model, "loc.obs", legend.loc="bottomleft", cex=.5, pch=c(3,4))
##plot tim-series for the first site,
layout(matrix(c(1,2,3,1,2,4),3,2))
plot(mesa.model, "obs", ID=1, col=c("red", "black"))
##residuals from the temporal trends,
plot(mesa.model, "res", ID=1, col=c("black","grey"))
##afc
plot(mesa.model, "acf", ID=1)
##... and pafc for the residuals
plot(mesa.model, "pacf", ID=1, ci.col="red")
##Different site and with no temporal trend.
mesa.model <- updateTrend(mesa.model, n.basis=0)
layout(matrix(c(1,2,3,1,2,4),3,2))
plot(mesa.model, "obs", ID="60370016")
plot(mesa.model, "res", ID="60370016")
plot(mesa.model, "acf", ID="60370016")
plot(mesa.model, "pacf", ID="60370016")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.