Re: [R] Select one row of a data frame

From: Jason Barnhart <jasoncbarnhart_at_msn.com>
Date: Wed 18 Oct 2006 - 19:01:27 GMT

?data.frame
?'[.data.frame'
will provide more information.

Here's an example:
> dfm4

          V1 V2 V3

1 0.38426342 0.4945156 1.970468
2 0.37361263 0.4988896 1.970468
3 1.30209319 2.2592985 1.145624
4 0.05995967 1.7020334 1.970468
5 1.39606662 2.2175071 1.970468
6 2.00257756 1.0196614 1.970468
7 2.00257756 0.5633546 1.582291
8 1.88368120 1.0475963 1.970468

> class(dfm4)

[1] "data.frame"
> dfm4[1,]

         V1 V2 V3
1 0.3842634 0.4945156 1.970468
>

> Can anyone tell me how to select just one row of a data frame? Say I
> want just the third row, what would be the syntax? Every notation I
> try just gives me columns.
>
> Thanks
>
> - Jason
>
> ______________________________________________
> 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.
>



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 Thu Oct 19 05:05:14 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 Wed 18 Oct 2006 - 19: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.