3
votes

Im trying to check my own package with

Rcmd.exe check dbt.ORA_1.0.tar.gz.

despite of adding "Depends: shiny in the Description file,

I get alot of warnings like this:

...

  • dbtORA: no visible global function definition for 'runApp'
  • dbtORA: no visible global function definition for 'fluidPage'
  • dbtORA: no visibleglobal function definition for 'titlePanel'
  • dbtORA: no visible global function definition for 'sidebarLayout'
  • dbtORA: no visible global function definition for 'sidebarPanel'
  • dbtORA: no visible global function definition for 'selectInput'
  • dbtORA: no visible global function definition for 'checkboxInput'
  • dbtORA: no visible global function definition for 'conditionalPanel'
  • dbtORA: no visible global function definition for 'numericInput'
  • dbtORA: no visible global function definition for 'actionButton'
  • dbtORA: no visible global function definition for 'mainPanel'
  • dbtORA: no visible global function definition for 'textOutput'
  • dbtORA: no visible global function definition for 'uiOutput'

...

the function dbtORA is very long, the source code is like this:

dbtORA <-function(){
...
outputApp=runApp(list(
  ui = fluidPage(
...
),
 server = function(input, output, session){
...
  }  
))
...
return(outputApp=NamedORAResults)}

I have in this context also a second question:

How do I declare functions, which are only locally defined, e.g. in

dbtORA <-function(){
...
matlabmin=function(...){...}
...}

gives the warning:

  • dbtORA: no visible global function definition for 'matlabmin'
1
There's a couple of fixes depending on whether or not there's a way to bind the variable in the package you're using. The universal fix is to put dbtORA <- NULL at the top of your script before the variable is called. The problem is you likely that have some sort of function that is probably reading a variable from a data.frame or list and using non standard evaluationTyler Rinker
dbtORA is a functon not variable, which uses alot other functions and is able to start a shiny interface. I dont understand your suggestionmthrun
Did you declare the package functiontions you're using in the NAMESPACE imprts? The solution depends on whether you manage this manually or with something like devtools.Tyler Rinker
Could you please elaborate this? I use Rstudio with Rtools, all checks are done automatically.mthrun
Do you use roxygen2? If not I highly recommend it (+ devtools ; which is built into alot of RStudio). Here's more on NAMESPACES: cran.r-project.org/doc/manuals/r-release/… but roxygen would make this management easier.Tyler Rinker

1 Answers

2
votes

For all of you, who have the same problem:

  1. In the DESCRIPTION file you have to write

    Imports: shiny

    and not

    Depends: shiny

  2. In the NAMESPACE file you have to write

    import(shiny)
    

No clue, why it has to be done like this only with shiny...