[R] match() question or needle haystack problem for a data.frame
bgunter@4567 @end|ng |rom gm@||@com
Mon Oct 22 18:02:35 CEST 2018
I suggest you spend a bit of time with an R tutorial or two and, in
particular learn about "logical indexing," as this basic R construct seems
to be mysterious to you.
On Mon, Oct 22, 2018 at 8:22 AM Knut Krueger <rhelp using krueger-family.de>
> Am 22.10.18 um 17:01 schrieb Eric Berger:
> > v <- match(Mydata$DATA1, needles, nomatch=NA)
> > > found <- Mydata[ !is.na <http://is.na>(v), ]
> > > missing <- Mdata[ is.na <http://is.na>(v), ]
> Thank you it is working, additionally as Bert suggested, it seems that
> Mydata[Mydata$DATA1 %in% needles,]
> is doing the same.
> Kind Regards Knut
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
[[alternative HTML version deleted]]
More information about the R-help