Last active
May 11, 2019 13:26
-
-
Save cgpu/5f2d3be7986e683a52e66313724e3f65 to your computer and use it in GitHub Desktop.
Select rows from a dataframe based on a list of values contained in column of choice.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| names_to_keep <- c('item1', 'item2', 'etc') | |
| df_sliced <- df[is.element(df$name , names_to_keep ), ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment