[R] xyplot (Lattice): Group order in display

jrflanders jrflanders at gmail.com
Wed Sep 1 17:27:37 CEST 2010


Dear R users,

I would like one of my groups in xyplot to appear to lie 'behind' the other
groups. I have searched for help and find many, many topics about panel
order (e.g., "as.table"), but that is not what I need. 

What is odd is that the group that I want to appear 'behind' the others
(PROFILE) is the last in alphabetical order but xyplot is plotting it first.
Any ideas? 

Code:
xyplot(Z_m~TEMP_C | LOCATION + EVENT, data = TC6, 
	groups = TYPE,
	aspect = 2,	
	as.table = TRUE, 
	ylim = c(120,0),
	between = list(y=2),
	lty = 0,
	strip = FALSE,
	type = "o", 
	jitter.x = TRUE, jitter.y = TRUE,
	pch = c(4,6,17,6,16), col.symbol = c("grey","blue","black","red","black"),
cex = 1.2,
	ylab = "Depth (m)", 
	xlab = expression(Temperature~"("~degree*C~")"),
	scales = list(
		y=list(at=seq(0,120,20), limits = c(120,0), cex = 1.2), 
		x=list(at=seq(3,18,3), alternating = c(2,1), limits = c(3,18), cex =
1.2)))

Example data:
EVENT, TRANSECT, LOC_CODE, TYPE, TEMP_C, Z_m
3	TC6	D	MAX	        15.6	1.2
3	TC6	D	MEAN	14.8	1.1
3	TC6	D	MIN	        14.4	1.0
3	TC6	D	POINT	11.3	55.8
3	TC6	D	POINT	11.3	58.3
3	TC6	D	POINT	11.3	58.3
3	TC6	D	PROFILE	16.0	3.3
3	TC6	D	PROFILE	16.0	3.2
3	TC6	D	PROFILE	15.2	8.9
3	TC6	D	PROFILE	12.6	14.8
3	TC6	D	PROFILE	12.5	14.8
3	TC6	D	PROFILE	11.6	21.2
3	TC6	D	PROFILE	11.5	26.9
3	TC6	D	PROFILE	11.4	33.3
3	TC6	D	PROFILE	11.4	39.5
3	TC6	D	PROFILE	11.3	45.4
3	TC6	D	PROFILE	11.3	50.2
3	TC6	D	PROFILE	11.3	54.1
3	TC6	D	PROFILE	11.3	53.5
-- 
View this message in context: http://r.789695.n4.nabble.com/xyplot-Lattice-Group-order-in-display-tp2403420p2403420.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list