Skip to content
Back to formatted view

Raw Message

Message-ID: <DB38DC457CF19544AD6BC484B60263AB99C544@Exch-MB-02-A.ITSIWC1.com>
Date: 2011-04-01T21:05:47Z
From: Guy Jett
Subject: XYPlot Conditioning Variable in Specific, Non-Alphanumeric Order. -- Resending with corrected .txt file
In-Reply-To: <AANLkTinpGgy=SnLc5b20_FYafCjh0V-7odsKNQtC+tgj@mail.gmail.com>

Thank you very much Deepayan.  This does exactly what I needed!
Cheers,
Guy Jett
gjett at itsi.com

-----Original Message-----
From: Deepayan Sarkar [mailto:deepayan.sarkar at gmail.com] 
Sent: Friday, April 01, 2011 6:51 AM
To: Guy Jett
Cc: r-help at R-project.org
Subject: Re: [R] XYPlot Conditioning Variable in Specific, Non-Alphanumeric Order. -- Resending with corrected .txt file

<snip>
You need to specify the order of the levels explicitly (to override
the default). Here is how to do it for one, you can similarly do the
other:

> levels(df$Offset)
 [1] "T" "U" "V" "Y" "Z" "A" "B" "C" "D" "E" "F" "G" "H"
> df$Offset <- factor(df$Offset,
+                     levels = c("T", "U", "V", "Y", "Z", "A",
+                                "B", "C", "D", "E", "F", "G", "H"))
> levels(df$Offset)
 [1] "T" "U" "V" "Y" "Z" "A" "B" "C" "D" "E" "F" "G" "H"

Once you make these changes, your original call should work as desired.

-Deepayan