[R] problem of using list element in for cycle

From: Hu Chen <chencheva_at_gmail.com>
Date: Mon 23 Oct 2006 - 14:57:10 GMT


sorry, pressed "sent" by mistake.
for example
>data <- read.csv("data.txt")
>data

            V1      V2
1      YHR165C  CG8877
2      YJL130C CG18572
3      YDL171C  CG9674
4      YKR054C  CG7507
5      YDL140C  CG1554
6      YLR106C CG13185
7      YGL206C  CG9012
8      YNL262W  CG6768
9      YER172C  CG5931

>typeof(data)

[1] "list"
>for (i in 1:nrow(data)){

     cat(data[i,1]
   }

it'll not return things like "YHR165C" but number like 6,7,9.. is this a new feature of list? how to turn off it. thanks

        [[alternative HTML version deleted]]



R-help@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 Tue Oct 24 01:02:28 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Mon 23 Oct 2006 - 15:30:13 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.