[R] xYplot error

Kang Min ngokangmin at gmail.com
Wed Jul 28 08:45:58 CEST 2010


Hi Frank,

Thanks for the suggestion. using numericScale() does work for Dotplot,
but there're still a few issues:

1. My factor names are Plot A, PF, MSF, and YSF, so numericScale turns
that into 3, 2, 1, 4 and the x-axis is plotted 1, 2, 3, 4. Is there
any way I can retain the same order on the graph?

2. I can't get the error bars displayed even after using
method="bars", only the mean, lower and upper bounds of the data as
points.

This the line I used: Dotplot(cbind(mort, mort + stand, mort - stand)
~ numericScale(site) | type, data = mort, method="bands")

Thanks for your help.

KM

On Jul 27, 9:58 pm, Frank Harrell <f.harr... at vanderbilt.edu> wrote:
> If the x-axis variable is really a factor, xYplot will not handle it.
> You probably need a dot chart instead (see Hmisc's Dotplot).
>
> Note that it is unlikely that the confidence intervals are really
> symmetric.
> Frank
>
>
>
> On Tue, 27 Jul 2010, Kang Min wrote:
> > Hi,
>
> > I'm trying to plot a graph with error bars using xYplot in the Hmisc
> > package. My data looks like this.
>
> > mort                    stand         site    type
> > 0.042512776   0.017854525   Plot A   ST
> > 0.010459803   0.005573305     PF      ST
> > 0.005188321   0.006842107    MSF    ST
> > 0.004276068   0.011592129    YSF     ST
> > 0.044586495   0.035225266   Plot A   LD
> > 0.038810662   0.037355408     PF     LD
> > 0.027567430   0.020523820    MSF   LD
> > 0.024698872   0.020320976    YSF   LD
>
> > Having read previous posts on xYplot being unable to plot x-axis as
> > factors, I used numericScale, but I still get this error.
>
> > Error in label.default(xv, units = TRUE, plot = TRUE, default =
> > as.character(xvname),  :
> >  the default string cannot be of length greater then one
>
> > I used:
>
> > xYplot(cbind(mort, mort + stand, mort - stand) ~ numericScale(site) |
> > type, method="bars")
>
> > Am I missing something or doing something wrong?
>
> > Thanks.
> > KM
>
> > ______________________________________________
> > R-h... at r-project.org mailing list
> >https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>
> ______________________________________________
> R-h... at r-project.org mailing listhttps://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list