BAR: Compositional bar plot

Description Usage Arguments Details Author(s) References See Also Examples

View source: R/BAR.r

Description

Horizontal bar plot of compositional data

Usage

1
2
3
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

DOT

Examples

1
2
3
4
5
6
# 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")

Example output

Loading required package: ca
Loading required package: vegan
Loading required package: permute
Loading required package: lattice
This is vegan 2.5-7
Loading required package: ellipse

Attaching package:ellipseThe following object is masked frompackage:graphics:

    pairs

easyCODA documentation built on Sept. 20, 2020, 1:07 a.m.