ShinyApp介紹
Reference from Building Web Applications with Shiny in R.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
View another note on Shiny Dashboard.
Example
Special Packages
- Plotly
- plotlyOutput()
- renderPlotly({})
- d3wordcloud
- d3wordcloudOutput()
- renderD3wordcloud({})
UI
Example
Reference:Shiny Widget
1. Siderbar
2. Theme
- shinythemes::shinytheme()
- Valid themes are:
- cerulean, cosmo, cyborg, darkly, flatly, journal, lumen, paper, readable, sandstone, simplex, slate, spacelab, superhero, united, yeti
Server
Example
1. Reactive Programming
- Reactive Source
- SelectInput
- TextInput
- etc.
- Reactive Endpoint
- tableOutput
- plotOutput
- etc.
- Reactive Conductor
- isolate
- Is used to prevent a reaction and NOT trigger it.
- It allows an expression to read a reactive value without triggering re-execution when its value changes.
- The text output updates only when user changes the height or weight, and NOT the name.
- eventReactive
- Is used to create a calculated value that only updates in response to an event.
- Use eventReactive to delay the execution of computing BMI until the user clicks on the button.
- observeEvent
- Is used to perform an action in response to an event.
- observe
- Add an observer to display notifications
- validate
- Add validation that user selected a input