R中遇到dplyr::filter等函数冲突--优先设置某个包

用conflicted包解决
参考:https://blog.csdn.net/qazplm12_3/article/details/119621588

#1 安装软件包
install.packages("conflicted")

#2 显示冲突的包
library(conflicted)
conflict_scout()

#3 设置优先使用的包的函数(例如上述的`filter()`: dplyr and stats冲突)
# 优先使用dplyr里面的filter函数
conflict_prefer("filter", "dplyr")

#4 其他
conflict_prefer("filter", "dplyr")
conflict_prefer("arrange", "dplyr")
conflict_prefer("compact", "dplyr")
conflict_prefer("count", "dplyr")
conflict_prefer("desc", "dplyr")
conflict_prefer("failwith", "dplyr")
conflict_prefer("id", "dplyr")
conflict_prefer("lag", "dplyr")
conflict_prefer("mutate", "dplyr")
conflict_prefer("rename", "dplyr")
conflict_prefer("summarise", "dplyr")
conflict_prefer("summarize", "dplyr")
posted @ 2024-04-16 19:01  corrschi  阅读(81)  评论(0编辑  收藏  举报