You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Updating testpkg documentation
Loading testpkg
Error in c(2, 4) %>% mean() (from test.R#7) : could not find function "%>%"
Calls: document ... withr_with_dir -> force -> source_many -> source_one -> eval -> eval
Execution halted
Is that expected behaviour?
My understanding was that roxygen2 should write all imports to the NAMESPACE file, but it already fails before the NAMESPACE file is written, because a package is not loaded.
obviously, this affects any other function that is used outside a function() in test.R and is not limited to %>%.
Note
If I use
#' A simple exported function
#'
#' @export
my_function = function() {
c(2.0, 5.0) %>% mean()
}
instead, everything works as expected.
The text was updated successfully, but these errors were encountered:
I have a minimal R package
with test.R:
and
Imports: dplyr
in myDESCRIPTION
.When I run
I get the following error message:
Is that expected behaviour?
My understanding was that roxygen2 should write all imports to the NAMESPACE file, but it already fails before the NAMESPACE file is written, because a package is not loaded.
obviously, this affects any other function that is used outside a
function()
intest.R
and is not limited to%>%
.Note
If I use
instead, everything works as expected.
The text was updated successfully, but these errors were encountered: