[R] Row-wise data retrieval

Henrik Bengtsson hb at maths.lth.se
Wed Nov 30 04:29:01 CET 2005


Vasundhara Akkineni wrote:
> I want to retrieve data row wise from a data frame. My data frame is as
> below:
> 
> data<-read.table("table.txt", header=TRUE)
 >
 > how can i get row-wise data?

Examples:

data[1,]
data[2,]

for (rr in 1:nrow(data))
   data[rr,]

rows <- c(1, 5:8, 3)
data[rows,]

/Henrik

> how can i get row-wise data?
> 
> Thanks,
> Vasu.
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> 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
> 
>




More information about the R-help mailing list