For the first question, add a groups argument. E.g.
barchart(HSI ~ Scenario | Region, Wbirdsm, groups = HydroState)
Also note that using Wbirdsm$HSI makes your call less readable, so I
added the data argument.
For your second question, setting the key does not set the color
theme. You want to set the colors using par.setting. E.g.
dotplot(HSI ~ Scenario | Region, Wbirdsm,
groups = HydroState,
par.settings = list(superpose.symbol =
list(col = c(red, green, blue))),
auto.key = list(space = right))
Then use auto.key instead of key.
HTH,
--sundar
On Wed, Mar 25, 2009 at 7:02 AM, steve_fried...@nps.gov wrote:
Hello, this is a request for assistance that I submitted earlier, this time
with the dataset. My mistake for taking up bandwidth. I've also rephrased
the question to address an additional concern.
I'm working on a windows XP machine with R 2.8.1
1). I'd like a barchart (or other lattice type display) HSI ~ of the three
factors (Region, Scenario and HydroState).
However barchart complains
library(reshape)
library(lattice)
barchart(Wbirdsm$HSI ~ WBirdsm$Scenario | WBridsm$Region)
# This works, but only marginally. I'd like specify the interaction
between the variables ( Scenario and HydroState)
What is the best way to combine these factors so they can be treated
as a single variable and rewrite the barchart call?
barchart(Wbirdsm$HSI ~ WBirdsm$interaction between Scenario and
HydroState) ~ Wbirdsm$Region)
The second question refers back to my original posting.
2) # using dotplot instead of barchart I use the following code.
key.variable - list(space = right, text =
list(levels(wbirdm$variable)), points = list(pch = 1:3,
col=c(red,green, blue)))
dotplot(wbirdm$value ~ wbirdm$variable | wbirdm$Region, col=c(1:9), pch=
rep(c(1:3), key = key.variable, groups=wbirdm$variable, ylab= Mean
HSI))
# However the key legend doesn't appear in the plot with this sequence
and the labels are too along the panels. Is there a way to address this?
thank you very much for the assistance.
Steve
This is part of the larger data base, after I passed it thru melt.
Region Species Scenario HydroState
HSI
1 Eastern Panhandle WBLong NSM Ave
0.165945170
2 Eastern Panhandle WBLong NSM Dry
0.056244263
3 Eastern Panhandle WBLong NSM Wet
0.290692607
4 Eastern Panhandle WBLong ECB Ave
0.165945170
5 Eastern Panhandle WBLong ECB Dry
0.056244263
6 Eastern Panhandle WBLong ECB Wet
0.290692607
7 Eastern Panhandle WBLong CERP Ave
0.165945170
8 Eastern Panhandle WBLong CERP Dry
0.056244263
9 Eastern Panhandle WBLong CERP Wet
0.290692607
10 Long Pine Key / South Taylor Slough WBLong NSM Ave
0.151159734
11 Long Pine Key / South Taylor Slough WBLong NSM Dry
0.067348863
12 Long Pine Key / South Taylor Slough WBLong NSM Wet
0.20738
13 Long Pine Key / South Taylor Slough WBLong ECB Ave
0.151159734
14 Long Pine Key / South Taylor Slough WBLong ECB Dry
0.067348863
15 Long Pine Key / South Taylor Slough WBLong ECB Wet
0.20738
16 Long Pine Key / South Taylor Slough WBLong CERP Ave
0.151159734
17 Long Pine Key / South Taylor Slough WBLong CERP Dry
0.067348863
18 Long Pine Key / South Taylor Slough WBLong CERP Wet
0.20738
19 Northern Taylor Slough WBLong NSM Ave
0.115503291
20 Northern Taylor Slough WBLong NSM Dry
0.005617136
21 Northern Taylor Slough WBLong NSM Wet
0.252428530
22 Northern Taylor Slough WBLong ECB Ave
0.115503291
23 Northern Taylor Slough WBLong ECB Dry
0.005617136
24 Northern Taylor Slough WBLong ECB Wet
0.252428530
25 Northern Taylor Slough WBLong CERP Ave
0.115503291
26 Northern Taylor Slough WBLong CERP Dry
0.005617136
27 Northern Taylor Slough WBLong CERP Wet
0.252428530
28 East Slough WBLong NSM Ave
0.313215457
29 East Slough WBLong NSM Dry
0.046917053
30 East Slough WBLong NSM Wet
0.447002596
31 East Slough WBLong ECB Ave
0.313215457
32 East Slough WBLong ECB Dry
0.046917053
33 East Slough WBLong ECB Wet
0.447002596
34 East Slough WBLong CERP