[R-pkg-devel] Confusion about what should be in Imports for a package with a shiny app

R. Mark Sharp rm@h@rp @end|ng |rom me@com
Wed Mar 24 17:19:52 CET 2021


As always, your answer is helpful. What you wrote agrees with my original understanding. I was somehow mislead by my interpretation of earlier tesing output and got on the wrong track. 

You are correct that the intent of the package is to enable more skilled users to use the package interactively or in their own scripts and applications. I will modify the DESCRIPTION file accordingly.

R. Mark Sharp, Ph.D.
Data Scientist and Biomedical Statistical Consultant
7526 Meadow Green St.
San Antonio, TX 78251
mobile: 210-218-2868
rmsharp using me.com

> On Mar 24, 2021, at 2:31 AM, Duncan Murdoch <murdoch.duncan using gmail.com> wrote:
> On 24/03/2021 12:16 a.m., R. Mark Sharp wrote:
>> I have a package (nprcgenekeepr) in which some packages listed in the DESCRIPTION file are used only within the shiny app scripts. For my prior CRAN submission (successful), I placed such packages in the Suggests section of the DESCRIPTION file. This time testing sites seemed to have directed me to place them in the Imports section and I now have multiple test environments (3 R-hub builder, 3 winbuilder, and 3 Travis-ci) that are showing no errors, warnings, or notes with that placement. However, the package check page https://cran.rstudio.com//web/checks/check_results_nprcgenekeepr.html site is showing the wrong package version (1.0.3 instead of 1.0.5) and some environments with a note of "Namespace in Imports field not imported from: ‘shinyBS’ All declared Imports should be used.”
>> I changed the function call from `popify` to `shinyBS::popify` and get the same results
>> I moved shinyBS to Suggests and I get the same note.
>> I also have shinyWidgets used within the same UI script and listed in the Imports section and it does not generate a note.
>> It appears that I have a basic misunderstanding of the message in the note and of where the `shinyBS` package should be listed within the DESCRIPTION file.
>> Help will be appreciated.
> The check code won't examine R code in your inst/application directory where the Shiny app code is kept, so that's why you get the "All declared Imports should be used" message.
> Your README says
> "The goal of nprcgenekeepr is to implement Genetic Tools for Colony Management. It was initially conceived and developed as a Shiny web application at the Oregon National Primate Research Center (ONPRC) to facilitate some of the analyses they perform regularly. It has been enhanced to have more capability as a Shiny application and to expose the functions so they can be used either interactively or in R scripts."
> This indicates that you expect some users aren't going to use the Shiny script, so they won't need shinyBS.  That means it should be in Suggests, not Imports, and your Shiny app should check whether it is available before trying to run it.
> If you think *most* users will want the Shiny app, then you could force it to be installed and loaded by putting it in Imports.  Then you'll have to make use of it somewhere in your main code to silence the message.  But it's probably better to leave it in Suggests.
> As to the "wrong package version" issue:  CRAN isn't showing 1.0.5 anywhere.  You may have submitted it, but it hasn't been accepted.  It's not in the CRAN queues, so you'll need to submit again if you want it on CRAN.
> Duncan Murdoch

More information about the R-package-devel mailing list