[Bioc-devel] Duplicated method names in purrr and GenomicRanges

Cook, Malcolm MEC @end|ng |rom @tower@@org
Thu Sep 12 17:42:12 CEST 2019


On this topic, one way of staying abreast of conflicts as you introduce them during the evolution of a project through use of the `conflicted` library toward the top of your project, usage modelled as follows:

```
## Force use of package prefixes for ALL conflicting function names
## lacking registered "preferences":
library(conflicted)
conflict_prefer("select", "AnnotationDbi", "MASS")
conflict_prefer("which", "BiocGenerics", "Matrix")
conflict_prefer("list", "base", "gsubfn") 
```
I've recently found this quite useful, but welcome arguments for/against this approach.

Cheers,

~Malcolm

> -----Original Message-----
> From: Bioc-devel <bioc-devel-bounces using r-project.org> On Behalf Of
> bioinf using posteo.de
> Sent: Thursday, September 12, 2019 4:07 AM
> To: bioc-devel <bioc-devel using r-project.org>
> Subject: [Bioc-devel] Duplicated method names in purrr and GenomicRanges
> 
> **CAUTION: Non-Stowers email**
> 
> 
> Dear all,
> 
> I am developing a Bioconductor package and have a problem with two
> methods which have the same name. I am using the reduce() function from
> the R packages GenomicRanges and purrr. All methods from other packages
> are imported with @importFrom in all of my functions.
> 
> 
> During devtools::document() I get the following Warning:
> 
> ...
> 
> replacing previous import ‘GenomicRanges::reduce’ by ‘purrr::reduce’
> when loading ‘testPackage’
> 
> ...
> 
> 
> Here are my NAMESPACE entries:
> 
> # Generated by roxygen2: do not edit by hand
> 
> export(mergeDataFrameList)
> export(reduceDummy)
> importFrom(GenomicRanges,GRanges)
> importFrom(GenomicRanges,reduce)
> importFrom(IRanges,IRanges)
> importFrom(dplyr,"%>%")
> importFrom(dplyr,left_join)
> importFrom(dplyr,mutate)
> importFrom(dplyr,pull)
> importFrom(magrittr,"%<>%")
> importFrom(purrr,reduce)
> importFrom(tibble,tibble)
> 
> 
> I am not using both reduce functions in the same function. To use the
> GenomicRanges reduce function, I have to call this function like this:
> GenomicRanges::reduce().
> 
> I understand the warning and why I have to call the reduce function like this.
> Is there a solution for this problem? Compiling a R package with warnings and
> calling functions like this is not the best way I guess.
> 
> I am using R version 3.6.1 (2019-07-05)
> 
> Thanks for help!
> 
> Best,
> 
> Tobias
> 
> _______________________________________________
> Bioc-devel using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/bioc-devel



More information about the Bioc-devel mailing list