stplot: Time series plot for each location

View source: R/stplot.R

stplotR Documentation

Time series plot for each location

Description

given a matrix where each line is a time series of each spatial unit, the time series are shown over the map

Usage

stplot(
  x,
  sp,
  d,
  col,
  ce,
  tsub = NULL,
  ex = 1,
  ey = 1,
  add = FALSE,
  legend = TRUE,
  leg.args = list(x = "bottomleft", lty = 1),
  verbose = FALSE,
  ...
)

Arguments

x

a matrix with each column containing data at each time for a set of geographical units

sp

an object as defined in the 'sp' package

d

a vector to specify a GridTopology object to do some subset over the sp object.

col

a vector of colors for each time series. If not provided, the collors will be defined considering the relative growth of each time series and series with similar growth will have similar colors. By default red color is for the series with most positive growth and blue for those with least growth.

ce

vector of coordinates to center the time the time series. If not provided, the coordinates output applied to sp.

tsub

if NULL, default, the colors consider the average of the time series. If integer, specifies the number of temporal subdivisions to evaluate the growth of each time series, used to define the colors.

ex

is a relative expansion factor for the x-axis extent

ey

is a relative expansion factor for the y-axis extent

add

logical indicating if the plot is to be added to a current plot

legend

logical indicatint if the legend is bo be drawn

leg.args

legend arguments, used if legend=TRUE

verbose

logical to specify if some steps are being reported during the process work

...

additional arguments passed to line used to plot each time series.

Examples

## Not run: 
## Consider data from the surveillance package
data(measlesWeserEms, package='surveillance')
if (any(ls()=='measlesWeserEms'))
  stplot(t(measlesWeserEms@observed),
         measlesWeserEms@map)

## End(Not run)

eliaskrainski/emisc documentation built on Nov. 18, 2024, 11:02 a.m.