function naming conflicts

后端 未结 2 628
一向
一向 2021-01-05 18:06

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

2条回答
  •  借酒劲吻你
    2021-01-05 18:13

    You can use ::, it helps to specify which package to use:

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

提交回复
热议问题