[R] Select one row of a data frame

Jason Barnhart jasoncbarnhart at msn.com
Wed Oct 18 21:01:27 CEST 2006


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


----- Original Message ----- 
From: "Jason Horn" <jhorn at bu.edu>
To: <R-help at stat.math.ethz.ch>
Sent: Wednesday, October 18, 2006 11:27 AM
Subject: [R] Select one row of a data frame


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



More information about the R-help mailing list