Skip to content
Prev 374671 / 398513 Next

Split a data.frame

...
yes, but note that:

which(data[[col]] %in% s

can be replaced directly by match:

match(data[[col]], s)

Corner cases (nothing matches, etc.) would also have to be checked and
probably should sort the matched row numbers for safety.

Cheers,
Bert

Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
On Sat, May 19, 2018 at 7:58 AM, Rui Barradas <ruipbarradas at sapo.pt> wrote: