filter() warning and unexpected result

I have one table called users in which there is a list of 17 users that I have to gather their data. I have another table daily_activity with a lot of records from a lot of users. I want to get all the records on the second table that correspond to those 17 users on the first table.
I wrote this:
daily_activity_filtered<-filter(daily_activity, Id==users$Id)
When I execute it not all the records from those 17 users get filtered, just few of them. And i get the following warning:
"Warning message:
In daily_activity_new$Id == users_complete_info$Id :
longer object length is not a multiple of shorter object length"

I think this is very basic statement but I cant understand what is failing.

Thank you for your support.

This is not a valid operation and even if the two vectors were of the same length you wouldn't get the result you expect.

Use the %in% operator instead of == or use left_join() instead of filter()

If you need more specific help, please provide a proper REPRoducible EXample (reprex) illustrating your issue.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.