4

I am developing a Shiny app at the moment and getting to a point with more functions than I expected. I plan to start automated testing with testthat and I would love to document my functions with roxygen2.

Since I am using RStudio, I started a new shiny app project. Now I am wondering, since I want the documentation and testing done, if I should instead start a package in RStudio to get all the devtools functions.

I am wondering, how to get the functions documented properly and like in the build, to test the examples. Plus using the testthat functions. How can I set up a project like this?

halfer
  • 19,824
  • 17
  • 99
  • 186
drmariod
  • 11,106
  • 16
  • 64
  • 110
  • 1
    http://r-pkgs.had.co.nz/ is a must; and imho packaging is a great way/idea to go one step further in R and programming as a whole. – Vincent Bonhomme Jun 09 '16 at 08:01
  • So, than maybe a stupid question, how do you get the `Run App` button to start the shiny app, or do you just execute the `shinyApp()` via hand? :-) – drmariod Jun 09 '16 at 08:21
  • 1
    would you like to lauch the app when you type `library(your_pkg)`? perhaps you can have a look [there](http://stackoverflow.com/questions/20223601/r-how-to-run-some-code-on-load-of-package). but you may also want to have the possiblity to run the app by hand. if you're not happy with this function you can create an alias eg `fire <- function() shinyApp(ui, server)` – Vincent Bonhomme Jun 09 '16 at 11:35
  • Thanks, I added the `fire` function already. – drmariod Jun 09 '16 at 13:31

1 Answers1

0

Since I found now a workflow which works for me, I described this on a different question.

developing shiny app as a package and deploying it to shiny server

Community
  • 1
  • 1
drmariod
  • 11,106
  • 16
  • 64
  • 110