3

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'
mthrun
  • 71
  • 1
  • 6
  • 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 evaluation](http://adv-r.had.co.nz/Computing-on-the-language.html) – Tyler Rinker Jan 19 '15 at 14:34
  • dbtORA is a functon not variable, which uses alot other functions and is able to start a shiny interface. I dont understand your suggestion – mthrun Jan 19 '15 at 14:47
  • 1
    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 Jan 19 '15 at 16:55
  • Could you please elaborate this? I use Rstudio with Rtools, all checks are done automatically. – mthrun Jan 19 '15 at 17:42
  • Do you use roxygen2? If not I highly recommend it (+ devtools ; which is built into alot of RStudio). Here's more on NAMESPACES: http://cran.r-project.org/doc/manuals/r-release/R-exts.html#Package-namespaces but roxygen would make this management easier. – Tyler Rinker Jan 19 '15 at 18:00

1 Answers1

2

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...

holzben
  • 1,459
  • 16
  • 24
mthrun
  • 71
  • 1
  • 6