Learn R Programming

spacetime (version 0.5-7)

stplot: produce trellis plot for STxDF object

Description

create trellis plot for ST objects

Usage

stplot(obj, ...)
stplot.STFDF(obj, names.attr = as.character(index(obj@time)), ..., 
	as.table = TRUE, at, cuts = 15, animate = 0, mode = "xy", scaleX = 0,
	auto.key = TRUE, key.space = "right")
stplot.STIDF(obj, names.attr = NULL, ..., as.table = TRUE, by =
    c("time", "burst", "id"), scales = list(draw = FALSE), xlab =
    NULL, ylab = NULL, type = 'p', number = 6, overlap = 0, asp,
	col = 1, panel = panel.stpointsplot, sp.layout = NULL)

Arguments

obj
object of a class deriving from ST
names.attr
names that will be used in the strip
as.table
logical; if TRUE, time will increas from top to bottom; if FALSE, time will increase from bottom to top
at
values at which colours will change; see levelplot
cuts
number of levels the range of the attribute would be divided into
animate
numeric; if larger than 0, the number of seconds between subsequent animated time steps (loop; press ctrl-C or Esc to stop)
mode
plotting mode; if "xy", maps for time steps are plotted; if "xt", a space-time plot is constructed (see argument scaleX, but read details below); if "ts", multiple-locations time series are plotted in a single plot, or in a separate panel fo
scaleX
integer: 0, 1 or 2; when mode is "xt", used to determine whether the index of the spatial location is shown (0), the x coordinate (1) or the y coordinate (2).
auto.key
see xyplot
key.space
character; see xyplot
by
conditioning variable(s); in case time is conditioning variable, it will be classified using equal.count, using parameters overlap and number
scales
scales drawing; see scales argument of xyplot
xlab
x-axis label
ylab
y-axis label
type
character; use 'l' for lines, 'p' for symbols, 'b' for both lines and symbols
number
see argument by
overlap
see argument by
asp
aspect ratio of plot
col
color for symbols
panel
panel function
sp.layout
list or NULL; see spplot
...
arguments passed on to spplot in case of stplot.STFDF, or to xyplot in case of stplot.STIDF

Value

  • In non-animation and "xy" mode, stplot is a wrapper around spplot, that automically plots each time stamp in a panel. The returned value is is a lattice plot.

    In "xt" mode, a space-time plot with space on the x-axis and time on the y-axis is plotted. By default, the space ID is plotted on the x-axis, as space can be anything (points, polygons, grid cells etc). When scaleX is set to 1 or 2, the x- resp. y-coordinates of the spatial locations, obtained by coordinates, is used instead. Beware: when the x-coordinate is plotted, and for each (x,t) element multiple y-coordinates are sent to the plot, it is not clear which (x,y,t) value becomes the plotted value, so slicing single y values is adviced -- no checking is done. The returned value is is a lattice plot.

    In animation mode (animate > 0), single maps are animated in an endless loop, with animate seconds between each. No proper value is returned: the loop needs to be interrupted by the user.