By simply changing the argument order in the join step, I can get the code below to run. I just installed the most recent version of Tidyverse as of this post (1.3.1), and I'm using R version 4.1.1 (2021-08-10), "Kick Things". Please end my madness:
Updates:
- If you run the the pipe without join statment, the assignment works fine (odd)
- I had an old version of the tidyverse (which I foolishly did not record), and the code would run. Now it does not with the latest version of tidyverse. Not to complicate things too much, but I did this on a different machine with R version R version 3.6.3 (2020-02-29).
library(dplyr)
#Doesn't run
if(exists("test")) rm("test")
iris%>%
assign(x = "test",value = .,envir = .GlobalEnv)%>%
left_join(x = test,y =. ,by="Species")
#Runs
if(exists("test")) rm("test")
iris%>%
assign(x = "test",value = .,envir = .GlobalEnv)%>%
left_join(x = .,y =test ,by="Species")