Filtering Column by Multiple values [duplicate]
问题 This question already has answers here : Filter multiple values on a string column in dplyr (4 answers) Closed 7 days ago . I would like to filter values based on one column with multiple values. For example, one data.frame has s&p 500 tickers, i have to pick 20 of them and associated closing prices. How to do it? 回答1: If I understand well you question, I believe you should do it with dplyr : library(dplyr) target <- c("Ticker1", "Ticker2", "Ticker3") filter(df, Ticker %in% target) The answer