hadley / mastering-shiny

Mastering Shiny: a book

Home Page:https://mastering-shiny.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

File organisation: not much info

nick-youngblut opened this issue · comments

the File organisation section doesn't have much info on actually organizing functions besides:

I recommend putting large functions (and any smaller helper functions that they need) into their own R/{function-name}.R file.

You might want to collect smaller, simpler, functions into one place. I often use R/utils.R for this, but if they’re primarily used in your ui you might use R/ui.R.

... assuming that one does not want to make a full-fledged package.

Questions that an shiny app developer might have:

  • Should I use source() to source the code from the *.R files in the R/ directory?
  • Can I have nested subdirectories in R/?
    • If using nested subdirectories, do I need to add files similar to __init__.py in python?