[R] Re: Need some quick help with lattice - barchart

From: Deepayan Sarkar <deepayan_at_stat.wisc.edu>
Date: Fri 06 May 2005 - 05:03:45 EST

On Thursday 05 May 2005 13:10, Ghosh, Sandeep wrote:
> For the following code below, the x-axis ticks are 1,2,3,4,5,6,7 when I was
> expection them to be 1,2,8,9,10,11,12. Please help me figure out where is
> the mistake.
[...]
> colnames(testdata) <- c('month', 'year', 'mean','stdDev','miceCount')
> testdata$month <- as.numeric(testdata$month)
[...]
> with(testdata, print(barchart(as.numeric(mean) ~ month | year,
> data=testdata, layout=c(1,length(levels(year))),
> horizontal=FALSE,
[...]

'month' is numeric, so it's being coerced to be a shingle. Try using 'factor(month)' instead in the formula.

Deepayan



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri May 06 05:02:49 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:36 EST