View source: R/plot.addSpiders.R
plotAddSpiders | R Documentation |
This function connects taxa's points with its centroids, thus forms a “spider” diagram.
plotAddSpiders(result, axes = c(1,2), col = "black", lty = 1, lwd = 1, ...)
result |
result of |
axes |
x, y axes of plot. |
col |
the colours for labels. |
lty |
the line type. Line types can either be specified as one of following types: 0=blank, 1=solid (default), 2=dashed, 3=dotted, 4=dotdash, 5=longdash, 6=twodash. |
lwd |
the line width. |
... |
further arguments to be passed to |
None. Used for its side effect of adding elements to a plot.
data(centaurea)
centaurea = naMeanSubst(centaurea)
centaurea = removePopulation(centaurea, populationName = c("LIP", "PREL"))
pcaRes = pca.calc(centaurea)
plotPoints(pcaRes, col = c(rgb(255, 0, 0, max = 255, alpha = 150), # red
rgb(0, 255, 0, max = 255, alpha = 150), # green
rgb(0, 0, 255, max = 255, alpha = 150), # blue
rgb(0, 0, 0, max = 255, alpha = 150)), # black
legend = FALSE, xlim = c(-5, 7.5), ylim = c(-5, 5.5))
plotAddLegend(pcaRes, col = c("red", "green", "blue", "black"), ncol = 2)
plotAddSpiders(pcaRes, col = c("red", "green", "blue", "black"))
plotPoints(pcaRes, col = c("red", "green", "blue","black"), legend = TRUE, cex = 0.4)
plotAddSpiders(pcaRes, col = c(rgb(255, 0, 0, max = 255, alpha = 150), # red
rgb(0, 255, 0, max = 255, alpha = 150), # green
rgb(0, 0, 255, max = 255, alpha = 150), # blue
rgb(0, 0, 0, max = 255, alpha = 150))) # black
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.