Hello, Is there an option I can easily set to put labels next to the points in a simple plot? The closest I got to it was to use the option pch, but this replaces the point symbol with the character specified, and it is not what I want. Thanks -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On 05/21/02 18:32, Daniel Mastropietro wrote:>Is there an option I can easily set to put labels next to the points in a >simple plot? >The closest I got to it was to use the option pch, but this replaces the >point symbol with the character specified, and it is not what I want.See text(). You might have to add a constant to have the text _next to_ the symbols. If you want to _replace_ the symbols, you can use type="n" in plot(), then use text() in the next command. Here is an example of the latter that I found in one of my own files: plot(vmtable[1:2,],type="n");text(vmtable[1:2,],cases) Here "cases" is a vector with the names I want plotted. -- Jonathan Baron, Professor of Psychology, University of Pennsylvania Home page: http://www.sas.upenn.edu/~baron -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
You can use text(), but you'll have to do some calculation on the exact placement of the label: plot(2, 3) text(2, 3 - .1, label = "my point") -roger _______________________________ UCLA Department of Statistics rpeng at stat.ucla.edu http://www.stat.ucla.edu/~rpeng On Tue, 21 May 2002, Daniel Mastropietro wrote:> Hello, > Is there an option I can easily set to put labels next to the points in a > simple plot? > The closest I got to it was to use the option pch, but this replaces the > point symbol with the character specified, and it is not what I want. > Thanks > > > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- > r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html > Send "info", "help", or "[un]subscribe" > (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._ >-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Wed, 22 May 2002, arcriswell wrote:> Hello All: > > Is there a function in R similar to multicomp() in S+ ?No. But there are TukeyHSD in base and pairwise.t.test and pairwise.wilcox.test in ctest, which cover part of the ground covered by multicomp. If you look in the archives you will see this has cropped up repeatedly, and you will find the arguments why adjustment for multiple comparisons is given little importance. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
There is a very simple and nice example of how to go about producing this result in John Maindonald's "Using R for data analysis and graphics", found at: http://cran.r-project.org/doc/contrib/usingR.pdf Section 3.3 Adding points lines and text would seem to be what you are after, including how to get the 1 character offsets for the label of each point. The example goes as follows, using files from JM's home page (there is link to it from http://cran.r-project.org/other-docs.html )> attach(primates) > plot(x=Bodywt, y=Brainwt, pch=16, xlab="Body weight (kg)",ylab="Brain weight (g)",xlim=c(5,240), ylim=c(0,1500))> chw < <- par()$cxy[1] > text(x=Bodywt+chw, y=Brainwt, labels=row.names(primates), adj=0)Which places labels to the right of the plotted points. Substitute your variables and row.names/vector of labels for the ones used above, but I'd recommend downloading JM's guide as it is a very good introduction to all things R. All the best Gavin Simpson %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~% Gavin Simpson [T] +44 (0)20 7679 5402 ENSIS Research Fellow [F] +44 (0)20 7679 7565 ENSIS Ltd. & ECRC [E] gavin.simpson at ucl.ac.uk UCL Department of Geography [W] http://www.ucl.ac.uk/~ucfagls/cv/ 26 Bedford Way [W] http://www.ucl.ac.uk/~ucfagls/ London. WC1H 0AP. %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~% -----Original Message----- From: owner-r-help at stat.math.ethz.ch [mailto:owner-r-help at stat.math.ethz.ch] On Behalf Of Daniel Mastropietro Sent: 21 May 2002 22:32 To: r-help at stat.math.ethz.ch Subject: [R] Point labels Hello, Is there an option I can easily set to put labels next to the points in a simple plot? The closest I got to it was to use the option pch, but this replaces the point symbol with the character specified, and it is not what I want. Thanks -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. -.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._. _._._._ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Wed, 22 May 2002, Prof Brian D Ripley wrote:> On Wed, 22 May 2002, arcriswell wrote: > > > Hello All: > > > > Is there a function in R similar to multicomp() in S+ ? > > No. But there are TukeyHSD in base and pairwise.t.test and > pairwise.wilcox.test in ctest, which cover part of the ground covered by > multicomp.And p.adjust in base -thomas Thomas Lumley Asst. Professor, Biostatistics tlumley at u.washington.edu University of Washington, Seattle -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Hello All: Is there a function in R similar to multicomp() in S+ ? Thanks, ANDREW -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._