[R] Inputting Co-ordinates

White.Denis@epamail.epa.gov White.Denis at epamail.epa.gov
Wed May 8 18:25:10 CEST 2002

> Hello
> I am trying to input some co-ordinate sets into R of the form x,y by
> lists.  The command I am using is:
> p1 <- list(x=c(3445,563,646), y=c(234,567,456))
> However the actual co-ordinate sets that I am trying to input have 305
> points each and I think that the program will not accept a command
that is
> as long as necessary.  Is this so?  If this is the case can you tell
me how
> to read the points in as a table but so that I can call on them as
being p1,
> later in the program?
> Many Thanks
> Louise

One easy way is to enter the coordinates into a text file with a text
editor so that the file looks like:

x y
3445 234
563 567
646 456

and then read into R with a statement

p1 <- read.table ("file.name", header=TRUE)

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