Re: [R] R: x-y data

From: John Kane <>
Date: Wed, 06 Jun 2007 11:15:46 -0400 (EDT)

There are a couple of ways but I think you need to read about R . Have a look at Managing data

and / or read the Intro to R manual available on CRAN or probably from the R help icon.

you have a data.frame DF you can assign names to the variables

names(DF) <- c("x", "y") and attach the data.frame


or you can reference the columns

as DF[,1] and DF[,2]

> Hello
> I have an Excel file with x-y data. I saved this
> file as a cvs file. Then I
> used the read.table() function to read the data into
> R. If I have a formula
> like (x+y)/2, how would I access x and y in R? I
> have the table named as
> something. But how do I access the individual
> columns if I want to plug them
> into the formula?

> Thanks
> -- mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Wed 06 Jun 2007 - 15:42:57 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 06 Jun 2007 - 16:31:23 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.