I get the following note when I run devtools::check()
checking R code for possible problems ... NOTE
ShinyChatbot: no visible binding for global variable ‘.Chatbot.title’
ShinyChatbot: no visible binding for global variable ‘.Chatbot.api_key
ShinyChatbot <- function(api_key, workspace, title="Chatbot powered by Watson") {
.GlobalEnv$.Chatbot.title <- title
.GlobalEnv$.Chatbot.api_key <- api_key
.GlobalEnv$.Chatbot.workspace <- workspace
on.exit(suppressWarnings(rm(list = c(.Chatbot.title, .Chatbot.api_key, .Chatbot.workspace), envir=.GlobalEnv)))
shiny::runApp(system.file('chat', package='IMWatson'))
}
I need to pass those variable to my app in order and I don't know how to do it without using a global or how to keep the globals and solve the devtools::check()
problem.
This previous question is related but the utils::suppressForeignCheck
did not solve the problem for me.