SecretIndividual
SecretIndividual

Reputation: 2519

dplyr equivalent for in

How would I write a dplyr statement that behaves like the in would in a SQL query.

Example in SQL

SELECT name
FROM Person
WHERE name IN (SELECT name FROM Worker)

Upvotes: 0

Views: 242

Answers (1)

akash87
akash87

Reputation: 3994

`library(dplyr)`

person %>% select(name) %>% filter(name %in% Worker$name)

I actually don't know what the datasets look like so this is 100% hunch.

Upvotes: 2

Related Questions