So I'm working on a project which requires me to combine dataframes with semi_join and anti_join from dplyr. However, instead of creating a data.frame as output, I get a dtplyr_step_subset object which I am unable to use and I have no idea how it works. (Note that this only happened after I updated my tidyverse package) Is there some argument for the join functions that fixes this?
Asked
Active
Viewed 96 times
1 Answers
0
It's difficult to know for certain without a reproducible example. But my best guess is that it is probably using semi_join
from dtplyr
, which gives you a data.table
. In general to avoid overlapping functions from different packages, I recommend specifying the package for functions. So, you would use dplyr::semi_join()
and dplyr::anti_join()
. Also, if you don't need dtplyr
then you can always detach it via detach("package:dtplyr", unload=TRUE)
.

AndrewGB
- 16,126
- 5
- 18
- 49
-
Yeah, I found out that the problem was having the dtplyr package loaded. After unloading it everything worked as I'd expected it to? – AntPalmer Jun 14 '21 at 04:33