Function's package conflict

Hi. Unusual situation to solve. I'm using two R packages and both of them have a function called "describe" to summarize statistics. The packages are "psych" and "qcc".
When a use "describe" I want to use from "psych" because is more complete but R/Rstudio takes "describe" from "qcc".
For a while I'm using the "describeBy" from "psych" but there is a warining message bacause I don't inform a "group" (of course because there is no one).
Is it possible to solve this conflict? Usually functions have different names but this case is a coincidence.
Thanks.
psych #qcc

You can just use the complete notation: package_name::function(). The package_name will clarify for R which namespace it should use.

1 Like

You have a conflict but it is not with qcc. qcc (Version 2.7 on my machine) does not have a describe function that I can see. I was going to suggest loading psych after qcc but discovered this when checking if it worked.

Do you, by any chance have Hmisc loaded?

``` r
library(qcc)
#> Package 'qcc' version 2.7
#> Type 'citation("qcc")' for citing this R package in publications.
data("warpbreaks")

describe(warpbreaks)
#> Error in describe(warpbreaks): could not find function "describe"

Created on 2023-02-19 with reprex v2.0.2

1 Like

Thank you. I will try this.

The updated version of 'qcc' package is not on CRAN repository. I'm using version 3.0 and you must install from Luca Scrucca Github (link). There some instruction to do so. I will take a look on 'Hmisc' packge. Thanks.

Never thought of that.. And yes I see it now has a {describe} function.

A quick check with the new {qcc} suggests that loading it before {psych} will work.

If you are only doing this occasionally @ FactOREO's suggestion is likely the safer solution. If you are doing it regularly, mine cuts down on typing and the odd times you forget the psych:: prefix.

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.