From murdoch.duncan at gmail.com  Wed Aug 26 13:30:26 2015
From: murdoch.duncan at gmail.com (Duncan Murdoch)
Date: Wed, 26 Aug 2015 07:30:26 -0400
Subject: [Rd] declaring dependencies of shiny app in inst/
In-Reply-To: <2CB2DA8E426F3541AB1907F98ABA6570B128F718@icexch-m1.ic.ac.uk>
References: <2CB2DA8E426F3541AB1907F98ABA6570B128F718@icexch-m1.ic.ac.uk>
Message-ID: <55DDA352.2060801@gmail.com>

On 26/08/2015 6:43 AM, Jombart, Thibaut wrote:
> Dear all, 
> 
> I have a package implementing a shiny app, putting the R code of the app (server.R and ui.R) in inst/... and then having a simple function merely starting the app with something along the lines of:
> runApp(system.file("inst/..."))
> 
> However, the app itself uses functions from packages which are not used elsewhere in the code. What is the best way to declare these dependencies (using roxygen2)? My 2-cents would be e.g a doc.R file with something along the lines of:
> [...]
> #' @importFrom pkg function1 function2
> NULL
> 
> But are their better ways / best practices?

You'll have to ask questions like these on a Shiny forum.

> On a related topic: are there plans of formally incorporating shiny apps in the structure of a R package, so that the checks will run through the code of the apps as well? 

No, but it would be very easy to do:  just write a function that tests
those things, and call it from a script in the tests directory.

Duncan Murdoch



[Rd] declaring dependencies of shiny app in inst/
Duncan Murdoch