Need to filter data from a table, where I have an input table as below
Emp_id = c(121,122,191,181,277,333)
salary = c(7838,8389,8940,9491,10042,10593)
Country = c("USA","USA","UK","USA","UK","USA")
df = data.frame(Emp_id,salary,Country)
and I have one more single character separated by a comma as below:
Emp_lst = "121,191,181"
Now, I need to filter df rows based on values in Emp_lst. For that, I have tried the code below, but I am getting 0 rows
library(dplyr)
df_flter = df %>% filter(Emp_id %in% Emp_lst)
Any Modification required in above code?