问题
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 can be found in https://stackoverflow.com/a/25647535/9513536
Cheers !
来源:https://stackoverflow.com/questions/50687466/filtering-column-by-multiple-values