[R] Controlling Order of Panels in Lattice Trellis Plots

Patrick Connolly p_connolly at slingshot.co.nz
Mon Feb 25 05:35:48 CET 2013


On Fri, 22-Feb-2013 at 11:02AM -0800, Rich Shepard wrote:

|>   With multiple panels in a lattice trellis plot the sequence is, for
|> example, 1, 10, 11, 12, 2, 3, 4. I want the sequence to be 1, 2, 3, 4, 10,
|> 11, 12.
|> 
|>   Reading ?strip.default and the appropriate section in the Lattice book I'm
|> not seeing how to specify the 'human' numeric order rather than the computer
|> numeric order.
|> 
|>   A pointer will be appreciated.

Without knowing what you're trying to do, I can't be sure, but I think
this pointer could give you an idea:


> cc <- 13:1
> levels(as.factor(cc))
 [1] "1"  "2"  "3"  "4"  "5"  "6"  "7"  "8"  "9"  "10" "11" "12" "13"
> levels(as.factor(as.character(cc)))
 [1] "1"  "10" "11" "12" "13" "2"  "3"  "4"  "5"  "6"  "7"  "8"  "9" 
> 

HTH

-- 
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.   
   ___    Patrick Connolly   
 {~._.~}                   Great minds discuss ideas    
 _( Y )_  	         Average minds discuss events 
(:_~*~_:)                  Small minds discuss people  
 (_)-(_)  	                      ..... Eleanor Roosevelt
	  
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.



More information about the R-help mailing list