Recap of Lab 9

Søren Helweg Dam

Exercises recap

Lab 9 Learning Objectives

A student who has met the objectives of the session will be able to:

  • Prepare a simple shiny application

  • Using relevant online resources to autonomously identify and obtain new and expand on existing knowledge of R

How to build an R shiny app

  • Use golem from the get-go
  • Start with layout (UI/UX)
  • Use online resources for inspiration
  • Bear in mind how declarative programming works
    • Use the reactivity slide for inspiration
  • Break your app into modules

Exercises

  • A lot of new stuff (functions, terms, ways of programming)
  • GitHub does not allow multiple people to push the same changes

Developing apps on the Shiny server

Shiny servers are not built for development.

  • Remember if you get a “Not Found” error, the “/shiny/” might be missing from the url.
  • Your app must be in ~/ShinyApps/ to be found.
  • If the app inexplicably don’t work, check the log in ShinyApps/log/ for error messages.
  • If no changes appear, close the tab for a minute and try again.
  • Close your app before continuing so future changes take effect.
  • Going forward, develop locally and deploy later.

Assignment recap

Challenges with shiny

  • New challenging topic
    • More how-to examples would be great
    • Requires more than fours hours to learn
    • Complex structure and logic
    • Does it matter where to put code? Yes, but no

Challenges with shiny

  • New challenging topic
    • More how-to examples would be great
    • Requires more than fours hours to learn
    • Complex structure and logic
    • Does it matter where to put code? Yes, but no
  • Hard to collaborate
    • Git-conflict galore

Challenges with shiny

  • New challenging topic
    • More how-to examples would be great
    • Requires more than fours hours to learn
    • Complex structure and logic
    • Does it matter where to put code? Yes, but no
  • Hard to collaborate
    • Git-conflict galore
  • Debugging is challenging, especially on a Shiny server
    • No error messages
    • Unclear when changes took effect

Pros and cons with golem

Once we got the hang of Golem, it became a valuable help for structuring and maintaining our application.

Pros and cons with golem

Once we got the hang of Golem, it became a valuable help for structuring and maintaining our application.

  • Encourages using modules
    • Breaks the app into small components
    • Helps testing and debugging
  • Provides a streamlined and structured workflow
    • Removes repetitive coding tasks and lets you focus on app logic and structure

Pros and cons with golem

Once we got the hang of Golem, it became a valuable help for structuring and maintaining our application.

  • Encourages using modules
    • Breaks the app into small components
    • Helps testing and debugging
  • Provides a streamlined and structured workflow
    • Removes repetitive coding tasks and lets you focus on app logic and structure
  • Encourages using modules
    • Hard to figure out how to put components together
    • Complicated in a small app
  • Steep learning curve
    • Overwhelming with so many files
    • Many functionalities to keep track of

Maintaining reproducibility

  • Reproducibility is important
  • Version control help managing changes
    • Show version number in the app
  • Hard to keep track of decisions made by the users
    • Enforce analysis workflow

Other challenges and limitations

  • Steep learning curve
  • Slow performance with large datasets or many users
  • Security issues
    • App server required?
  • Limited graphical design?