Adding a str_sub replacement in an R package, checking fails
fernandoroa opened this issue · comments
Fernando Roa commented
I am getting:
no visible global function definition for
‘str_sub<-’
Undefined global functions or variables:
str_sub<-
When running
R CMD check --as-cran package.tar.gz
I don't know how to fix it. I have tried all the answers found in several sites.
Problem arises having something like this in a function
str_sub(param) <- " "
Fernando Roa commented
A workaround is to add
require(stringr)
or better:
use :: or requireNamespace()
inside the function with the replacement
str_sub(...) <- ""