Skip to content

Instantly share code, notes, and snippets.

@DoktorMike
Created May 30, 2019 12:30
Show Gist options
  • Save DoktorMike/bc15402657d56997e047092944d302cc to your computer and use it in GitHub Desktop.
Save DoktorMike/bc15402657d56997e047092944d302cc to your computer and use it in GitHub Desktop.
Filter away all that match publisherlist
library(tidyverse)
mydf <- tibble(publisher=sample(LETTERS[1:10], 10, replace=TRUE), investment=rnorm(10, 100000, 20000))
mydf
mydf %>% filter(publisher %in% c('B', 'G'))
mydf %>% filter(!(publisher %in% c('B', 'G')))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment