plot.mefa {mefa} | R Documentation |
Various methods for plotting objects of class 'mefa'.
## S3 method for class 'mefa': plot(x, stat = 1:4, type = c("bar", "rank"), trafo = c("none", "log", "ratio"), ylab = NULL, xlab = NULL, show = TRUE, ...) ## S3 method for class 'mefa': boxplot(x, stat = 1:4, ylab = NULL, xlab = NULL, show = TRUE, ...) ## S3 method for class 'mefa': image(x, segm=NULL, trafo=c("none", "log", "bins", "prab"), probs = seq(0, 1, 0.05), ordering = TRUE, reverse = TRUE, ylab = NULL, xlab = NULL, show = TRUE, ...)
x |
an object of class 'mefa'. |
stat |
numeric, to determine which characteristic to plot. 1 : number of species in samples (default), 2 : total number of indiwiduals in samples, 3 : number of occurrences per taxa, 4 number of individuals per taxa. |
type |
character, "bar" produces barchart (default), "rank" ranked curves based on the characteristic defined by stat . |
trafo |
character, transformation of the plotted variable. "none" : no transformation (default), "log" : logarithmic transformation (base 10), "ratio" : normalizes values by the maximum and rescales to the [0, 1] interval (useful for plotting multiple rank abundance curves), "bins" : recodes the values according to quantiles based on probs , "prab" : presence absence transformation of count data. |
ylab, xlab |
character to overwrite default label for the y and x axes. If NULL , than default labels are returned on the plot. |
segm |
if NULL the x$xtab matrix is used for plotting. Otherways, this defines the segment (one element in x$segm ) for plotting (can be numeric or character with the name of the segment). |
probs |
numeric vector of probabilities with values in [0, 1] (passed internally to qvector ). |
ordering |
logical, if TRUE (default) the samples-by-taxa matrix is ordered by row and columns sums, if FALSE row and columns are not rearranged. |
reverse |
logical, if the values to plot should be reversed (TRUE , default, original zero values are lightly, while higher values are strongly coloured) or not (FALSE ). This is related to col argument of the generic function image . Currently, heat.colors is the default color scheme. |
show |
logical, produce a plot (TRUE ) or not (FALSE ). FALSE can be useful, if the returned plotted values are reused (e.g. the matrix returned invisibly image can be used by filled.contour , or multiple values are used in one plot). |
... |
further arguments to pass to plotting functions. See especially zlim and col arguments of the generic function image , and arguments for the generic function boxplot . |
plot
returns barchart, or ranked curve of summary statistics (number of species, individuals in samples, number of occurrences or abundence of taxa) based on the x$xtab
matrix of the 'mefa' objects. These walues are basically returned by summary.mefa
.
boxplot
returns box-and-whiskers plots for the summary statistics based on matrices for each segments in x$segm
.
image
creates a grid of colored rectangles with colors corresponding to the values in the segment defined by the argument segm
. If ordering = TRUE
, the ordering of the segment will be based on the x$xtab
matrix and not on the matrix for the segment itself. This is due to better comparison among segments.
All methods produce a plot if show = TRUE
, and return the plotted values if show = FALSE
without plotting them.
Péter Sólymos, solymos@ualberta.ca
Sólymos P. 2008. mefa: an R package for handling and reporting count data. Community Ecology 9, 125–127.
http://mefa.r-forge.r-project.org/
image
, plot
, boxplot
, filled.contour
, par
, heat.colors
, heat.colors
, topo.colors
, terrain.colors
, rainbow
data(DOLINAcounts, DOLINAsamples, DOLINAtaxa) x <- mefa(stcs(DOLINAcounts), DOLINAsamples, DOLINAtaxa) ## Histograms par(mfrow=c(2,2)) plot(x, 1) plot(x, 2) plot(x, 3) plot(x, 4) par(mfrow=c(1,1)) ## Ranked curves par(mfrow=c(2,2)) plot(x, 1, type="rank") plot(x, 2, type="rank") plot(x, 3, type="rank") plot(x, 4, type="rank") par(mfrow=c(1,1)) ## Boxplot for segments par(mfrow=c(2,2)) boxplot(x, 1) boxplot(x, 2) boxplot(x, 3) boxplot(x, 4) par(mfrow=c(1,1)) ## Image (levelplot) ## comparing all and the segments par(mfrow=c(1,3)) image(x, trafo = "bins", main = "All segments") image(x, segm = 1, trafo = "bins", main = dimnames(x)$segm[1]) image(x, segm = 2, trafo = "bins", main = dimnames(x)$segm[2]) par(mfrow=c(1,1))