s1d.gauss: 1-D plot of a numeric score by Gaussian curves

View source: R/C1.gauss.R

s1d.gaussR Documentation

1-D plot of a numeric score by Gaussian curves

Description

This function represents a score with a Gauss curve for each level of a factor.

Usage

s1d.gauss(score, fac = gl(1, NROW(score)), wt = rep(1,
  NROW(score)), steps = 200, col = NULL, fill = TRUE,
  facets = NULL, plot = TRUE, storeData = TRUE, add =
  FALSE, pos = -1, ...)

Arguments

score

a numeric vector (or a data frame) used to produce the plot

fac

a factor (or a matrix of factors) to split score

wt

a vector of weights for score

steps

a value for the number of segments used to draw the Gauss curves

col

a logical, a color or a colors vector for labels, rugs, lines and polygons according to their factor level. Colors are recycled whether there are not one color by factor level.

fill

a logical to yield the polygons Gauss curves filled

facets

a factor splitting score so that subsets of the data are represented on different sub-graphics

plot

a logical indicating if the graphics is displayed

storeData

a logical indicating if the data are stored in the returned object. If FALSE, only the names of the data arguments are stored

add

a logical. If TRUE, the graphic is superposed to the graphics already plotted in the current device

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 storeData is FALSE

...

additional graphical parameters (see adegpar and trellis.par.get)

Details

Graphical parameters for rugs are available in plines of adegpar and the ones for Gauss curves filled in ppolygons. Some appropriated graphical parameters in p1d are also available.

Value

An object of class ADEg (subclass C1.gauss) or ADEgS (if add is TRUE and/or if facets or data frame for score or data frame for fac are used).
The result is displayed if plot is TRUE.

Author(s)

Alice Julien-Laferriere, Aurelie Siberchicot aurelie.siberchicot@univ-lyon1.fr and Stephane Dray

See Also

C1.gauss ADEg.C1

Examples

data(meau, package= "ade4")
envpca <- ade4::dudi.pca(meau$env, scannf = FALSE)
dffac <- cbind.data.frame(meau$design$season, meau$design$site)
g1 <- s1d.gauss(envpca$li[, 1], fac = dffac, fill = TRUE, col = 1:6)
update(g1, steps = 10)
g2 <- s1d.gauss(envpca$li[, 1], dffac[, 2], ppoly.col = 1:4, paxes.draw = TRUE, ylim = c(0, 2), 
  fill = TRUE, p1d.hori = FALSE)

adegraphics documentation built on Oct. 13, 2023, 5:11 p.m.