[R] Change in lattice dotplot?

Deepayan Sarkar deepayan.sarkar at gmail.com
Wed Apr 12 02:56:25 CEST 2006


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




More information about the R-help mailing list