Hi,

I'm an R beginner and I'm struggling with what should be a rudimentary task.

My data is along these lines:

ID name1 name2 name3 name4
Class 0 1 0 2
Var1 A B C A
Var2 B C C A
Var3 C A B A

etc.

I'm using the following:

foo <- data.frame(t(read.table("file", header=FALSE)))

but of course now it's not using ID, Class, etc. as column names.

As you can imagine, I'd like to be able to use, say, foo$Var2 or foo$ID.

What's the best way to achieve this?

Dion

--
View this message in context: 
http://r.789695.n4.nabble.com/Reading-then-transposing-from-file-tp4480313p4480313.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@r-project.org 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.

Reply via email to