[R] Help with the 'legend' command

Ko-Kang Kevin Wang Ko-Kang at xtra.co.nz
Mon Jun 10 01:22:12 CEST 2002


----- Original Message -----
From: "David Alan Shilane" <dshilane at stanford.edu>
To: <R-help at stat.math.ethz.ch>
Sent: Monday, June 10, 2002 10:38 AM
Subject: [R] Help with the 'legend' command


> Hi-
>    I'm trying to create a legend for a data plot containing four different
> sets of information of case numbers over time; one set for each of the
> four countries in my study.  I'm trying to create a legend that will show
> the reader what type of point character I'm using for each country.  I
> have the names of the four countries stored as a 4x1 vector called
> "names", and their corresponding pch values are 19,20,23,25.  Here's the
> part of the command that I have working so far:
>
> legend(1980, 80000, names, .........)
>
> In place of the ......., I'd like to insert the argument that will give it
> the proper pch values for each country.  What should I do?

Something like:
   legend(1980, 80000,
              legend = c("Country 1", "Country 2", "Country 3", "Country
4"),
              pch = c(19, 20, 23, 25))
should do...


------------------------------------------------
Ko-Kang Kevin Wang
Post Graduate PGDipSci Student
Department of Statistics
University of Auckland
New Zealand
www.stat.auckand.ac.nz/~kwan022


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list