s.arrow | R Documentation |
This function represents a two dimensional scatter plot with arrows linking points to the origin.
s.arrow(dfxy, xax = 1, yax = 2, labels = row.names(as.data.frame(dfxy)),
facets = NULL, plot = TRUE, storeData = TRUE, add = FALSE, pos = -1, ...)
dfxy |
a data frame used to produce the plot |
xax |
an integer (or a vector) indicating which column(s) of |
yax |
an integer (or a vector) indicating which column(s) of |
labels |
a character vector containing labels for arrows |
facets |
a factor splitting the rows of |
plot |
a logical indicating if the graphics is displayed |
storeData |
a logical indicating if the data are stored in
the returned object. If |
add |
a logical. If |
pos |
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 |
... |
additional graphical parameters (see
|
An other origin for arrows can be specified using an adegpar
parameters: porigin
.
Graphical parameters for points and arrows are available in parrows
and ppoints
of adegpar
.
An object of class ADEg
(subclass S2.arrow
) or ADEgS
(if add
is TRUE
and/or
if facets or vectors for xax
/yax
are used).
The result is displayed if plot
is TRUE
.
Alice Julien-Laferriere, Aurelie Siberchicot aurelie.siberchicot@univ-lyon1.fr and Stephane Dray
S2.arrow
ADEg.S2
data(doubs, package = "ade4")
dudi1 <- ade4::dudi.pca(doubs$env, scale = TRUE, scannf = FALSE, nf = 3)
dudi2 <- ade4::dudi.pca(doubs$fish, scale = TRUE, scannf = FALSE, nf = 2)
coin1 <- ade4::coinertia(dudi1, dudi2, scannf = FALSE, nf = 2)
g11 <- s.arrow(coin1$l1, plabels.cex = 0.87, plot = FALSE)
g12 <- s.arrow(coin1$c1, plabels.cex = 1, plabels.col = "red", plot = FALSE)
g1 <- superpose(g12, g11, plot = TRUE)
xy <- cbind(rnorm(50), rnorm(50))
g2 <- s.arrow(xy, plabels.cex = 0.9, plines = list(lwd = 1.5), parrows.angle = 20)
update(g2, plines = list(col = rainbow(5)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.