[R] Understanding lattice barchart() display

Rich Shepard rshepard at appl-ecosys.com
Wed Oct 24 14:56:51 CEST 2012


On Tue, 23 Oct 2012, Peter Ehlers wrote:

> As Bert correctly points out, you have more than one quant value per
> tclass/stream combination. You need to summarize your 1987-case data.frame
> to a 56-case data.frame (8 levels of tclass and 7 levels of stream). The
> easy way to do that is:
>
> benthos2 <- aggregate(quant ~ tclass + stream, data = benthos,
>                       FUN = sum)
>
> Then just use benthos2 as the data argument to barchart().

Peter,

   Thank you. I'll learn the aggregate function and do as you suggest.

Regards,

Rich




More information about the R-help mailing list