Re: [R] R: x-y data

From: john seers (IFR) <john.seers_at_bbsrc.ac.uk>
Date: Wed, 06 Jun 2007 15:45:21 +0100

 

tt<-read.table("C:/temp/test.csv", header=T, sep=",")

# Try:

tt$x
tt$y

# OR

tt["x"]
tt["y"]

# OR

tt[["x"]]
tt[["y"]]

# OR

tt[1]
tt[2] 
tt[[1]]
tt[[2]]

# Is this what you want?

>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?



R-help_at_stat.math.ethz.ch 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. Received on Wed 06 Jun 2007 - 15:21:45 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 - 15:31:44 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.