BAR {easyCODA} | R Documentation |
Compositional bar plot
Description
Horizontal bar plot of compositional data
Usage
BAR(data, cols=rainbow(ncol(data)), col.names=colnames(data),
row.names=rownames(data), order.column=NA, eps=0.5, main="", ylab="",
ylim=c(0,nrow(data)), xlim=c(0,100), cex=1, truncate=NA)
Arguments
data |
Compositional data matrix or data frame with compositions in rows, parts in columns |
cols |
Colours of points for each part, default rainbow |
col.names |
Part names, if modified |
row.names |
Sample names, if modified |
order.column |
By default parts are taken in order of columns, but can be re-ordered using this option |
eps |
Small space between bars, can be modified |
main |
Heading |
ylab |
Vertical axis label |
ylim |
Vertical axis limits (default is the number of rows in data) |
xlim |
Horizontal axis limits (default c(0,100)) |
cex |
Character size scaling factor for labels |
truncate |
Truncate part (column) names to this number of characters for legend |
Details
The function BAR
makes a BAR plot for specified groups of points, which can be in columns of a matrix or data frame.
Author(s)
Michael Greenacre
References
Greenacre, M. (2016), Data reporting and visualization in ecology, Polar Biology: 39, 2189-2205.
See Also
Examples
# Vegetables data set: order samples by carbohydrates
data(veg)
BAR(veg, order.column=2)
data(time)
# TimeBudget data set: put domestic work in first column and order by it
BAR(time[,c(2,1,3,4,5,6)], order.column=1, main="Time Budget")