Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

"Note: possible error in 'or(...)'" during R CMD INSTALL #64

Open
salim-b opened this issue Nov 20, 2020 · 1 comment
Open

"Note: possible error in 'or(...)'" during R CMD INSTALL #64

salim-b opened this issue Nov 20, 2020 · 1 comment

Comments

@salim-b
Copy link
Contributor

salim-b commented Nov 20, 2020

I use a simple

rex::rex(start, or("1st_string",
                   "2nd_string",
                   "3rd_string",
                   "4th_string"))

in an R package and followed the advice to call rex::register_shortcuts(pkg_name = "my_pkg") to avoid NOTEs by R CMD Check.

But when building the package, R CMD INSTALL prints a note like:

** byte-compile and prepare package for lazy loading
Note: possible error in 'or("1st_string", ': unused arguments ("3rd_string", "4th_string") at (...)

What's happening here?

When I wrap the strings in an additional c(), the note goes away. But rex:::or() takes a dots argument

> rex:::or
function (...) 
{
    group(regex(paste0(collapse = "|", unlist(escape_dots(...)))))
}
<bytecode: 0x56006a276840>
<environment: namespace:rex>

so why the complaint about unused arguments? (they're actually properly used, it's just R CMD INSTALL that complains...)

@jimhester
Copy link
Member

Looks to me like a false positive from R CMD check, unfortunately there is not much we can do about it other than using your suggested workaround.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants