Cauder
Cauder

Reputation: 2617

How can I check what is associated with a function name?

When I load dplyr and Hmisc, I get a conflict for the function summarize.

Is there a way that I can see all the functions associated with summarize and the priority. Right now, summarize defaults to Hmisc and I'd like it to default to dplyr.

Upvotes: 2

Views: 73

Answers (1)

www
www

Reputation: 39154

We can use the conflict_scout from the conflicted package.

library(dplyr)
library(Hmisc)
library(conflicted)

conflict_scout()
# 11 conflicts:
# * `filter`     : dplyr, stats
# * `format.pval`: [Hmisc]
# * `intersect`  : [dplyr]
# * `lag`        : dplyr, stats
# * `Position`   : ggplot2, base
# * `setdiff`    : [dplyr]
# * `setequal`   : [dplyr]
# * `src`        : Hmisc, dplyr
# * `summarize`  : Hmisc, dplyr
# * `union`      : [dplyr]
# * `units`      : [Hmisc]

And if you want to set the summarize function from the dplyr to be in priority, you can use conflict_prefer.

conflict_prefer("summarize", "dplyr")

Upvotes: 2

Related Questions