# bar.group: Plotting the multiple comparison of means In agricolae: Statistical Procedures for Agricultural Research

## Description

It plots bars of the averages of treatments to compare. It uses the objects generated by a procedure of comparison like LSD, HSD, Kruskall, Waller-Duncan, Friedman or Durbin. It can also display the 'average' value over each bar in a bar chart.

## Usage

 `1` ```bar.group(x, horiz = FALSE, ...) ```

## Arguments

 `x` Object created by a test of comparison `horiz` Horizontal or vertical bars `...` Parameters of the function barplot()

## Details

x: data frame formed by 5 columns: name of the bars, height and level of the bar.

## Value

A list with numeric vectors giving the coordinates of all the bar midpoints drawn.

 `x` eje-1 coordinate `height` eje-2 coordinate by group

## Author(s)

Felipe de Meniburu

`LSD.test`, `HSD.test`, `kruskal` , `friedman`, `durbin.test`, `waller.test` , `plot.group`

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21``` ```# Example 1 library(agricolae) data(sweetpotato) model<-aov(yield~virus,data=sweetpotato) comparison<- LSD.test(model,"virus",alpha=0.01,group=TRUE) print(comparison\$groups) #startgraph par(cex=1.5) bar.group(comparison\$groups,horiz=TRUE,density=8,col="blue",border="red", xlim=c(0,50),las=1) title(cex.main=0.8,main="Comparison between\ntreatment means",xlab="Yield",ylab="Virus") #endgraph # Example 2 library(agricolae) x <- 1:4 y <- c(0.29, 0.44, 0.09, 0.49) xy <- data.frame(x,y,y) #startgraph par(cex=1.5) bar.group(xy,density=30,angle=90,col="brown",border=FALSE,ylim=c(0,0.6),lwd=2,las=1) #endgraph ```

### Example output

```  trt    means  M
1  oo 36.90000  a
2  ff 36.33333  a
3  cc 24.40000 ab
4  fc 12.86667  b
```

agricolae documentation built on Sept. 13, 2017, 1:03 a.m.