[R] DOT PLOT help!!

MacQueen, Don macqueen1 at llnl.gov
Tue Nov 25 02:10:04 CET 2014


Turns out that
  stripchart()
is the easiest way to get what I believe the OP is looking for.

Here is some example data

tmp <- data.frame( g=sample(c('M','F'), 25, replace=TRUE),
                   val = runif(25, 1, 10))


Then:
  stripchart(val ~ g, data=tmp, vertical=TRUE)
or with some improvement to aesthetics:
  stripchart(val ~ g, data=tmp, vertical=TRUE, xlim=c(0.5, 2.5))


This was actually not easy to find, and I am a very experienced R user.
  help.search('dotplot')
did not find it.
  require(sos)
  findFn('dotplot')
did not find it.

This is despite the fact that
  ?stripchart
refers to itself as a function to create "dot plots".

(So I do not think the OP should be chided for having difficulty)


I did not find
  dotchart()
to be useful, because it has a different concept of "dot plot", and I
could not easily find a way to make it do the version I believe the OP
wants. Unfortunately, that's what internet searching for "R dotplot" tends
to lead to.

Of course, if I misunderstand the OP request, this is so much blather!

-Don

-- 
Don MacQueen

Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062





On 11/24/14, 11:21 AM, "Jeff Newmiller" <jdnewmil at dcn.davis.ca.us> wrote:

>"Some" of the web sites are likely always going to be over your head. The
>correct strategy is to find some that are within reach, and work your way
>through them. If you cannot copy some example code into R and execute it
>from one of the sites that comes up when you search for "R dotplot" (e.g.
>[1]) then you won't have much success communicating in a mailing list.
>You really need to be able to give us the sequence of commands you are
>having trouble with to get useful assistance via email.
>
>One of the biggest stumbling blocks for new R users is understanding
>data, how it is imported, and how it is stored [2]. It might not seem
>like the most likely place to start, but the Intro to R document and the
>Importing Data document that come with R have a treasure trove of useful
>stuff. If you need more handholding than that then there are quite a few
>books and online courses.
>
>[1] http://www.statmethods.net/graphs/dot.html
>[2] R is interactive..  learn to use the str function and the help system
>(try typing ?str at the R prompt) to examine variables that examples are
>using.
>--------------------------------------------------------------------------
>-
>Jeff Newmiller                        The     .....       .....  Go
>Live...
>DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live
>Go...
>                                      Live:   OO#.. Dead: OO#..  Playing
>Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
>/Software/Embedded Controllers)               .OO#.       .OO#.
>rocks...1k
>--------------------------------------------------------------------------
>- 
>Sent from my phone. Please excuse my brevity.
>
>On November 24, 2014 1:08:39 AM PST, Juan Scheun
><jscheun at zoology.up.ac.za> wrote:
>>Morning everyone
>>
>>
>>I am relatively new to R and although there are tons of "how to"
>>websites,
>>some are just way over my head. I am currently trying to figure out how
>>to
>>create dot plot graphs with my data, where I have categories (i.e male
>>/female) and values for each. I would like to display this as
>>categories
>>on the x axis and all values for each directly above the applicable
>>category, thus not a scatter graph but in a line above for each.
>>
>>I have attached a quick picture I found on the internet to demonstrate
>>roughly what I would like.
>>
>>Thank you all for your time
>>Juan Scheun
>>Department of Zoology and Entomology
>>University of Pretoria
>>Lynnwood Road
>>Hillcrest
>>Pretoria
>>South Africa
>>0002
>>
>>Cell: +27 76 860 3315
>>Email: jscheun at zoology.up.ac.za
>>
>>
>>
>>
>>---------------------------------------------------------------------
>>This message and attachments are subject to a disclaimer. Please refer
>>to http://www.it.up.ac.za/documentation/governance/disclaimer/ for full
>>details. / Hierdie boodskap en aanhangsels is aan 'n vrywaringsklousule
>>onderhewig. Volledige besonderhede is by
>>http://www.it.up.ac.za/documentation/governance/disclaimer/ beskikbaar.
>>
>>
>>------------------------------------------------------------------------
>>
>>______________________________________________
>>R-help at r-project.org mailing list
>>https://stat.ethz.ch/mailman/listinfo/r-help
>>PLEASE do read the posting guide
>>http://www.R-project.org/posting-guide.html
>>and provide commented, minimal, self-contained, reproducible code.
>
>______________________________________________
>R-help at r-project.org mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list