This function represents a two dimensional scatter plot with trajectories.
s.traject(dfxy, fac = gl(1, nrow(dfxy)), order, labels = levels(fac),
xax = 1, yax = 2, col = NULL, facets = NULL, plot = TRUE,
storeData = TRUE, add = FALSE, pos = -1, ...)
An object of class ADEg
(subclass S2.traject
) or ADEgS
(if add
is TRUE
and/or
if facets or multidimensional fac
or vectors for xax
/yax
are used).
The result is displayed if plot
is TRUE
.
a data frame used to produce the plot
a factor (or a matrix of factors) splitting the rows of dfxy
a vector containing the drawing order of the trajectories. A vector of length equal to factor.
a vector of character strings containing the trajectories' labels
an integer (or a vector) indicating which column(s) of dfxy
is(are) plotted on the x-axis
an integer (or a vector) indicating which column(s) of dfxy
is(are) plotted on the y-axis
a color or a colors vector to color points, labels and lines
a factor splitting the rows of dfxy
so that subsets
of the data are represented on different sub-graphics
a logical indicating if the graphics is displayed
a logical indicating if the data should be stored in
the returned object. If FALSE
, only the names of the data
arguments are stored
a logical. If TRUE
, the graphic is superposed to the graphics
already plotted in the current device
an integer indicating the position of the
environment where the data are stored, relative to the environment
where the function is called. Useful only if storeData
is
FALSE
additional graphical parameters (see
adegpar
and trellis.par.get
)
Alice Julien-Laferriere, Aurelie Siberchicot aurelie.siberchicot@univ-lyon1.fr and Stephane Dray
The fac
factor is used to display several trajectories: each level of fac
is a specific trajectory.
S2.traject
ADEg.S2
rw <- function(a) {
x <- 0
for(i in 1:49) x <- c(x, x[length(x)] + runif(1, -1, 1))
x
}
x1 <- unlist(lapply(1:5, rw), use.names = FALSE)
y1 <- unlist(lapply(1:5, rw), use.names = FALSE)
z1 <- gl(5, 50)
g1 <- s.traject(data.frame(x1, y1), z1, ppoints.pch = 19:23, plines.col = rainbow(5))
x2 <- unlist(lapply(1:2, rw), use.names = FALSE)
y2 <- unlist(lapply(1:2, rw), use.names = FALSE)
z2 <- gl(2, 50)
g2 <- s.traject(data.frame(x2, y2), z2, ppoints.pch = 21:20, plines.col = 1:2)
Run the code above in your browser using DataLab