mirror of
https://github.com/rstudio/shiny.git
synced 2026-02-18 10:31:51 -05:00
Merge pull request #12 from jeffreybreen/jb-tutorial-typos
fixed minor typos
This commit is contained in:
@@ -45,7 +45,7 @@ To turn reactive values into outputs that can viewed on the web page, we assigne
|
||||
})
|
||||
</code></pre>
|
||||
|
||||
This function will be re-executed (and it's output re-rendered in the browser) whenever either the `datasetInput` or `input$obs` value changes.
|
||||
This function will be re-executed (and its output re-rendered in the browser) whenever either the `datasetInput` or `input$obs` value changes.
|
||||
|
||||
### Back to the Code
|
||||
|
||||
@@ -99,7 +99,7 @@ library(datasets)
|
||||
# Define server logic required to summarize and view the selected dataset
|
||||
shinyServer(function(input, output) {
|
||||
|
||||
# By declaring databaseInput as a reactive function we ensure that:
|
||||
# By declaring datasetInput as a reactive function we ensure that:
|
||||
#
|
||||
# 1) It is only called when the inputs it depends on changes
|
||||
# 2) The computation and result are shared by all the callers (it
|
||||
@@ -145,4 +145,4 @@ shinyServer(function(input, output) {
|
||||
})
|
||||
</code></pre>
|
||||
|
||||
We've reviewed a lot code and covered a lot of conceptual ground in the first three examples. The next section focuses on the mechanics of building a Shiny appliation from the ground up and also covers tips on how to run and debug Shiny applications.
|
||||
We've reviewed a lot code and covered a lot of conceptual ground in the first three examples. The next section focuses on the mechanics of building a Shiny application from the ground up and also covers tips on how to run and debug Shiny applications.
|
||||
|
||||
@@ -47,7 +47,7 @@ The server side of the application has also gotten a bit more complicated. Now w
|
||||
* A reactive function to return the dataset corresponding to the user choice
|
||||
* Two other reactive functions (`reactivePrint` and `reactiveTable`) that return the output$summary and output$view values
|
||||
|
||||
These reactive functions work similarly to the `reactivePlot` function used in the first example: by declaring a reactive function you tell Shiny that it should only be executed when it's dependencies change. In this case that's either one of the user input values (input$dataset or input$n)
|
||||
These reactive functions work similarly to the `reactivePlot` function used in the first example: by declaring a reactive function you tell Shiny that it should only be executed when its dependencies change. In this case that's either one of the user input values (input$dataset or input$n)
|
||||
|
||||
#### server.R
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ shinyUI(pageWithSidebar(
|
||||
|
||||
### Tabs and Reactive Data
|
||||
|
||||
Introducing tabs into our user-interface underlines the importance of creating reactive functions for shared data. In this example each tab provides it's own view of the dataset. If the dataset is expensive to compute then our user-interface might be quite slow to render. The server script below demonstrates how to calculate the data once in a reactive function and have the result be shared by all of the output tabs:
|
||||
Introducing tabs into our user-interface underlines the importance of creating reactive functions for shared data. In this example each tab provides its own view of the dataset. If the dataset is expensive to compute then our user-interface might be quite slow to render. The server script below demonstrates how to calculate the data once in a reactive function and have the result be shared by all of the output tabs:
|
||||
|
||||
#### server.R
|
||||
|
||||
@@ -80,7 +80,7 @@ shinyServer(function(input, output) {
|
||||
|
||||
# Generate a plot of the data. Also uses the inputs to build the
|
||||
# plot label. Note that the dependencies on both the inputs and
|
||||
# the data reactive function are both tracked, and all functions
|
||||
# the 'data' reactive function are both tracked, and all functions
|
||||
# are called in the sequence implied by the dependency graph
|
||||
output$plot <- reactivePlot(function() {
|
||||
dist <- input$dist
|
||||
|
||||
Reference in New Issue
Block a user