Last updated: 2019-04-11
Checks: 2 0
Knit directory: for-future-reference/
This reproducible R Markdown analysis was created with workflowr (version 1.2.0.9000). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.
Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.
Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility. The version displayed above was the version of the Git repository at the time these results were generated.
Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish
or wflow_git_commit
). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:
Ignored files:
Ignored: .Rhistory
Ignored: .Rproj.user/
Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.
These are the previous versions of the R Markdown and HTML files. If you’ve configured a remote Git repository (see ?wflow_git_remote
), click on the hyperlinks in the table below to view them.
File | Version | Author | Date | Message |
---|---|---|---|---|
Rmd | 5d6218b | John Blischak | 2019-04-11 | Add notes on Shiny. |
Some notes on using Shiny from the DataCamp course Building Web Applications in R with Shiny:
To require that an input not be NULL
, put req(input$n)
inside of the reactive function. This is especially useful to avoid throwing an error before the user has a chance to enter a value.
To select multiple values from a potentially long list, set multiple = TRUE
for the UI function selectInput()
. The default selectize = TRUE
will show potential values that update as the user types.
To optionally display output, put if (input$id)
inside of a render function. To include UI as well, use conditionalPanel()
.
plotOutput(brush = "id")
-> Server: brushedPoints(df, brush = input$id)
plotOutput(hover = "id")
-> Server: nearPoints(df, coordinfo = input$id)
textOutput()
(div tag) - use for normal textverbatimTextOutput()
(pre tag) - use to format as codeIn UI, refer to IDs as strings. Order matters. In Server, refer to IDs as elements of list. Order doesn’t matter.
Download data - UI: downloadButton()
, Server: downloadHandler()
Output arbitrary HTML that includes reactive components - UI: outputUI()
, Server: renderUI()
To view reactlog, run options(shiny.reactlog = TRUE)
and click Ctrl+F3 while Shiny app is open.
observe()
- automatically perform side effectreactive()
- automatically recalculate valueobserveEvent()
- perform side effect when triggeredeventReactive()
- recalculate value when triggeredthemeSelector()
widget to UIui <- fluidPage(theme = shinytheme("cerulean"),
Can use individual HTML tags such as p()
, br()
, etc. or directly write HTML with HTML()
.