Skip to content

dotchart {graphics} 2.11.1 vs. 2.12.1

4 messages · Van Patten, Isaac T, Joshua Wiley, Peter Ehlers

#
I have a factor vector of subject races (Asian, Black, Hispanic, White; n=30) that I want to plot with a Cleveland dotplot or dotchart.

I tried the following in R2.12.1 :
Error in plot.xy(xy.coords(x, y), type = type, ...) : invalid plot type
 
Using the same data set in R2.11.1 the operation succeeded (I tried several variations to be sure):
Each of these worked in 2.11.1 but not in 2.12.1;  What changed in the {graphics} package to alter this and is there a work-around?

Isaac T. Van Patten, Ph.D.
Professor of Criminal Justice
307 Adams Street, Office 1A
Box 6934, Radford University
Radford, VA 24142
(540)831-6737
ivanpatt at radford.edu
http://ivanpatt.asp.radford.edu
It doesn't matter how beautiful your theory is;
It doesn't matter how smart you are;
If it doesn't agree with the [data], its wrong.
                                            -Richard Feynman
#
Hi,

Its a bit messy, but here is a quick work around:

dotchart(as.matrix(table(infert$education))[,1])

I wonder if this has something to do with the addition of table
methods for points() and lines().  I'll post back if I find anything
more out.


Cheers,

Josh

On Tue, Feb 1, 2011 at 6:52 AM, Van Patten, Isaac T
<ivanpatt at radford.edu> wrote:

  
    
#
On 2011-02-01 07:09, Joshua Wiley wrote:
Will this suffice:

  dotchart(c(table(infert$education)))

Peter Ehlers
#
On Tue, Feb 1, 2011 at 9:23 AM, Peter Ehlers <ehlers at ucalgary.ca> wrote:
That is probably the cleanest answer for now (I tried something like
that with as.vector(), but lost the names).  Another reasonable option
would be:
dotchart(unclass(table(infert$education)))

2D tables work fine presently:  dotchart(table(state.division, state.region))

I started a thread on R-devel suggesting a few possible solutions, so
perhaps in the next release, dotchart() will be able to handle table
class objects without any coercion.

Josh