[R] Dot plot - equivalent of MINITAB

Charilaos Skiadas cskiadas at gmail.com
Thu Sep 25 22:46:39 CEST 2008


I think the problem is that what you describe is not what some  
people, R folks included, refer to as "dotplot", though I suppose  
wikipedia as well as some other top google links seem to agree with  
you and minitab. What you describe I think can be obtained with  
something like:

x<- c(6,6,4,4,4,4,2,2,2,2,2,10)
cnt <- table(x)
xs <- rep(as.numeric(names(cnt)), cnt)
ys <- do.call("c", sapply(cnt, function(x) 1:x))
plot(xs,ys, pch=19, ylim=c(0,10))

The R-dotplot you can think of, if you want, as a replacement of a  
barchart, which replaces the entire bar with a single dot where the  
bar would end. It can also be used when the scale you are using has  
nothing to do with counts, and doesn't even have to start from 0. But  
I am far from an expert, and I am sure/hope a bunch of people will  
jump in to correct me.

There are surely other descriptions of dotplots, but you could start  
with these:

http://www.processtrends.com/pg_charts_dot_plots.htm
http://www.b-eye-network.com/view/2468

Haris Skiadas
Department of Mathematics and Computer Science
Hanover College

On Sep 25, 2008, at 3:51 PM, kerfuffle wrote:

>
> hi folks,
>
> Bit of a newbie, but I've spent a fair bit of time looking for an  
> answer on
> this, with no joy.  Can anyone help me?
>
> Dataset: A single column of values in a csv file (eg. 52, 53, 54,  
> 85, etc)
>
> Goal: In Minitab, you have what they call a dot plot.  It's a  
> histogram,
> where a single dot represents a set of identical values (eg. 57,  
> 57, 57
> would be one dot).   Multiple dots are stacked on top of each other  
> (as if
> gravity was affecting them). The advantage is that outliers are  
> very visible
> (since a single 155 still gets a single dot).  The net effect is a  
> rug plot,
> but in the main portion of the plot, not just on the axis.
>
> Tried: I've played with dotchart and dotchart2 with no joy (eg.
> dotchart(nc$bac) (where nc is the dataset and bac is the column  
> header).
> They do provide multiple dots (so that ten values of 57 are given 3  
> dots)
> but these overlap and aren't arranged in a logical way.  Sometimes  
> a single
> dot has a large y-value, sometimes it isn't.  As a result of this
> non-gravitational effect, it doesn't look like a histogram at all.   
> It's
> also strange that the background of the plot is stripy.  This  
> implies I'm
> doing something very wrong, but don't know what.  I had a look at  
> the plot
> galleries, and didn't see anything else that looked like what I wanted
> (except the rug plots).
>
> thanks! (and apologies if I've missed something blatant)
>
> Paul
> -- 
> View this message in context: http://www.nabble.com/Dot-plot--- 
> equivalent-of-MINITAB-tp19677009p19677009.html
> Sent from the R help mailing list archive at Nabble.com.
>
>



More information about the R-help mailing list