Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upQuestion - Using as.period within a package #664
Comments
|
It should work without attaching the package. ## in a new session on a similar platform as yours
> lubridate::as.period(x = 10, unit = 'day')
[1] "10d 0H 0M 0S"Might be an instalation issue. Please try to reinstall lubridate. If you use lubridate as imports you can also specify which functions you would like to use and use them without #' @importFrom lubridate as.periodor in NAMESPACE
|
|
Odd. It might be an installation issue. On the + side, |
|
Actually I can reproduce. It's because of the match.fun within as.period. It looks like that function has a non dynamic lookup which is rather unexpected. Give me a sec. |
|
Actually it has a dynamic lookup which was the cause of the problem. Thanks for reporting this! |
|
Wow, super quick!! Thanks @vspinu ! |
Hello,
Situation
I don't wish to write
require(lubridate)in my package. However, not doing so results in an error.Error & Reproducible Example
In a brand new R session.
In a brand new R session.
Why is this behavior true?
Background
I'm writing a package which uses the
lubridate::as.periodfunction and would like to make a call like:(In the package,
lubridateis set asImports:)Version Information