[R] Extracting rows of a data.frame by "identical"

jpm miao miaojpm at gmail.com
Tue May 3 04:56:04 CEST 2016


Is it possible? I am expecting the result to be the second row of the data
frame ...


d<-data.frame(a=1:3, b=3:5,c=9:11)
> d
  a b  c
1 1 3  9
2 2 4 10
3 3 5 11
> d[identical(d[c("b","c")],c(4,10)),]
[1] a b c
<0 rows> (or 0-length row.names)

	[[alternative HTML version deleted]]



More information about the R-help mailing list