How to stop anti_join from reversing sort order in R?

喜夏-厌秋 提交于 2019-12-11 01:38:48

问题


I have two sets of names that are ordered A-Z. I'm using anti_join to filter out whatever is present in the 2nd set. Example:

library(dplyr)
t1 <- data.frame(Name = state.name, Abbr = state.abb)
t2 <- data.frame(Abbr = state.abb[50])
t3 <- anti_join(t1, t2, by = "Abbr")

The result is in reverse sort order. I tried adding ascending/descending=TRUE but nothing. Is there a way to keep the sort order intact, without adding another line, that I am missing?

来源:https://stackoverflow.com/questions/42310771/how-to-stop-anti-join-from-reversing-sort-order-in-r

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!