[R] select row
John Kane
jrkrideau at yahoo.ca
Tue Jul 3 11:43:37 CEST 2007
?which
Use it to find the rows and then extract the rows
selection <- mydata[which(mydata$id=="25-2006"), ]
should work.
--- Leonardo Lami <lami at faunalia.it> wrote:
> Hi all,
> I have a little problem selecting some rows from a
> data.frame.
> I'd like to select the rows where a determinated
> column take a
> partivolar value.
>
> For example:
> tab
> id x y
> 1 24-2005 1621814 4834991
> 2 24-2005 1621856 4834907
> 3 24-2005 1621763 4834956
> 4 25-2006 1622330 4835189
> 5 25-2006 1622533 4834834
> 6 25-2006 1622535 4834909
> 7 25-2006 1622543 4834803
> 8 28-2005 1622798 4835043
> 9 28-2005 1622299 4835129
>
> I'd like to select the row where id=25-2006
>
> I searched on the search of the R site but I did'nt
> find anything of simple.
> Can someone help me?
>
> Thank you very much
> Leonardo
>
> ______________________________________________
> 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