Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

sco.class

1D plot of a numeric score and a factor with labels


Description

Draws evenly spaced labels, each label linked to the corresponding values of the levels of a factor.

Usage

sco.class(score, fac, label = levels(fac), clabel = 1, horizontal = TRUE, 
    reverse = FALSE, pos.lab = 0.5, pch = 20, cpoint = 1, boxes = TRUE, 
    col = rep(1, length(levels(fac))), lim = NULL, grid = TRUE, 
    cgrid = 1, include.origin = TRUE, origin = c(0, 0), sub = "", 
    csub = 1.25, possub = "bottomleft")

Arguments

score

a numeric vector

fac

a factor

label

labels for the levels of the factor

clabel

a character size for the labels, used with par("cex")*clabel

horizontal

logical. If TRUE, the plot is horizontal

reverse

logical. If horizontal = TRUE and reverse=TRUE, the plot is at the bottom, if reverse = FALSE, the plot is at the top. If horizontal = FALSE, the plot is at the right (TRUE) or at the left (FALSE).

pos.lab

a values between 0 and 1 to manage the position of the labels.

pch

an integer specifying the symbol or the single character to be used in plotting points

cpoint

a character size for plotting the points, used with par("cex")*cpoint. If zero, no points are drawn

boxes

if TRUE, labels are framed

col

a vector of colors used to draw each class in a different color

lim

the range for the x axis or y axis (if horizontal = FALSE), if NULL, they are computed

grid

a logical value indicating whether a grid in the background of the plot should be drawn

cgrid

a character size, parameter used with par("cex")* cgrid to indicate the mesh of the grid

include.origin

a logical value indicating whether the point "origin" should belong to the plot

origin

the fixed point in the graph space, for example c(0,0) the origin axes

sub

a string of characters to be inserted as legend

csub

a character size for the legend, used with par("cex")*csub

possub

a string of characters indicating the sub-title position ("topleft", "topright", "bottomleft", "bottomright")

Value

The matched call.

Author(s)

Examples

data(meau)
envpca <- dudi.pca(meau$env, scannf=FALSE)
par(mfrow=c(2,1))
sco.class(envpca$li[,1],meau$design$season, col = 1:6)
sco.class(envpca$li[,1],meau$design$season, col = 1:4, reverse = TRUE)

ade4

Analysis of Ecological Data: Exploratory and Euclidean Methods in Environmental Sciences

v1.7-16
GPL (>= 2)
Authors
Stéphane Dray <stephane.dray@univ-lyon1.fr>, Anne-Béatrice Dufour <anne-beatrice.dufour@univ-lyon1.fr>, and Jean Thioulouse <jean.thioulouse@univ-lyon1.fr>, with contributions from Thibaut Jombart, Sandrine Pavoine, Jean R. Lobry, Sébastien Ollier, Daniel Borcard, Pierre Legendre, Stéphanie Bougeard and Aurélie Siberchicot. Based on earlier work by Daniel Chessel.
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.