[R] Arrangement of Lattice Histograms - Top to bottom and then left to right?

From: Les <lnharris_at_zoology.ubc.ca>
Date: Tue, 05 Apr 2011 13:37:09 -0500 (CDT)


Hi List,
Using Lattice, I have created a plot of histograms showing Fork Length by Year. The plot shows the histograms in 3 columns and 5 rows. Using the as.table=T function I can get the years to start on top. However, what I would like to do is have the first year start in the top left (column 1, row 1; as it is now) and add the subsequent histograms to the plot going down the column and then over by row (example and current code is shown below). Is this possible? I have spent a great deal of time searching, and have not found any clues. Any help/ideas would be greatly appreciated.

For example, what is being done now:

1974 1975 1976
1977 1978 1979
1980 1981 1982

and what I am hoping for:

1974 1977 1980
1975 1978 1981
1976 1979 1982

Thank you kindly,
Les

data=read.csv("AllData.csv",sep=",",header=T) data$year=as.factor(data$year)
ferg=data[data$wtrbody=="Ferguson",c(1:12)] library(lattice)

strip.background=trellis.par.get("strip.background") trellis.par.set(strip.background = list(col = grey(7:1/8)))

histogram(~fl|year, data=ferg, as.table=T, type="count",

	col='dark grey',layout=c(3,5),lwd=2, lty=1, 		
	xlab=list("Fork Length (mm)", cex=1.4,font=2),		
	breaks=seq(from=300,to=900,by=25),			
	ylab=list("Frequency",cex=1.4,font=2),			
	scales=list(font=2,cex=1.1, tck=c(1,0), alternating=1, 	
	y=list(relation="free",tick.number=3)),						
	par.strip.text=list(cex=1.2),font=2, 			
	aspect=0.6)

--
View this message in context: http://r.789695.n4.nabble.com/Arrangement-of-Lattice-Histograms-Top-to-bottom-and-then-left-to-right-tp3428825p3428825.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Tue 05 Apr 2011 - 18:47:58 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 05 Apr 2011 - 21:00:27 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive