Function naming conflicts

What are some good development patterns with packages that define the same function? In my case, lubridate and data.table both define wday .

+6
source share
2 answers

You can use :: , this helps indicate which package to use:

 lubridate::wday function (x, label = FALSE, abbr = TRUE) UseMethod("wday") <environment: namespace:lubridate> data.table::wday function (x) as.POSIXlt(x)$wday + 1L <environment: namespace:data.table> 
+8
source

Use the namespace mechanism for your packages. See Manual R Extensions.

+3
source

All Articles