Dear list, I used to have this code in a Sweave document: sel <- placeDF$Place == "Velar" & placeDF$manner == "Plosive" table(placeDF$agem[sel], placeDF$place[sel]) -> pd print( dotplot( prop.table(pd,margin=1), auto.key=list( space="right" ), xlab="Relative Frequency", ylab="Age (months)", stack=T, par.settings = list(superpose.fill = list(col rev(gray.colors(40)[1:40 %% 4 == 1] ))) ) ) This used ot produce a dotplot with the proportion of each value in pd relative to the entire row. Each column constituted a separate group. Now, with an ugrade of all packages, I have lost the groups. Is there a way to get them back? (The pd table displayed below) /Fredrik> pdLabial Dental Alveolar Postalveolar Retroflex Palatal Velar Uvular 18 0 1 0 0 0 0 10 0 19 1 1 0 0 0 0 9 0 20 0 3 0 0 0 0 11 0 21 1 3 0 0 0 0 17 0 22 0 0 0 0 0 0 8 0 23 0 9 0 0 0 0 32 0 24 0 2 0 0 0 0 20 0 25 1 1 0 0 0 0 28 0 26 1 7 0 0 1 0 37 0 27 2 7 0 0 1 0 35 0 28 0 3 0 0 0 0 32 0 29 0 4 0 0 3 0 29 0 30 4 10 0 0 1 0 30 0 31 0 6 0 0 1 0 14 0 32 2 2 0 0 0 0 18 0 33 0 13 0 0 2 0 26 0 34 0 2 0 0 1 0 28 0 35 2 1 0 0 0 0 25 0 36 0 3 0 0 0 0 10 0 37 0 1 0 0 1 0 14 0 38 0 2 0 0 0 0 6 0 39 0 2 0 0 0 0 7 0 40 0 0 0 0 2 0 14 0 41 1 2 0 0 1 0 10 0 42 1 0 0 0 1 0 12 0 43 0 1 0 0 1 0 13 0 44 0 1 0 0 1 0 8 0 45 0 0 0 0 1 0 11 0 46 0 0 0 0 2 0 5 0 47 0 2 0 0 4 0 9 0 48 0 0 0 0 2 0 7 0 49 0 0 0 0 2 0 5 0 50 0 0 0 0 0 0 8 0 51 0 0 0 0 1 0 7 0>
On 4/11/06, Fredrik Karlsson <dargosch at gmail.com> wrote:> Dear list, > > I used to have this code in a Sweave document: > > > > sel <- placeDF$Place == "Velar" & placeDF$manner == "Plosive" > table(placeDF$agem[sel], placeDF$place[sel]) -> pd > print( > dotplot( > prop.table(pd,margin=1), > auto.key=list( > space="right" > ), > xlab="Relative Frequency", > ylab="Age (months)", > stack=T, > par.settings = list(superpose.fill = list(col > rev(gray.colors(40)[1:40 %% 4 == 1] ))) > ) > )Many of your arguments don't make sense for dotplot (they do for barchart).> This used ot produce a dotplot with the proportion of each value in pd > relative to the entire row. Each column constituted a separate group. > > Now, with an ugrade of all packages, I have lost the groups. > Is there a way to get them back?Hard to say without any version information. The following uses grouping by default with R 2.2.1 and lattice 0.12-11 (both dotplot and barchart): pd = as.table(matrix(sample(c(rep(0, 10), 21:30), 20 * 6, TRUE), 20, 6)) dotplot(prop.table(pd, margin = 1), auto.key = list(space = "right")) barchart(prop.table(pd, margin = 1), auto.key = list(space = "right"))> (The pd table displayed below)This is not a very useful form. What does str(pd) say? Deepayan