You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are many types of input and output types in RShiny, we will discuss these types at length in the upcoming lessons. In this example, we are **creating a text input** using the `textInput()` function. There are two arguments:
154
+
There are many types of input and output in RShiny, we will discuss these types at length in the upcoming lessons. In this example, we are **creating a text input** using the `textInput()` function. There are two arguments:
155
155
156
156
1. The first argument, `inputId`, is the variable name for the user input to be stored to.
157
157
2. The second argument, `label`, is a character string representing the text which will be placed above the input text box.
@@ -191,10 +191,10 @@ Inside the function we place the following code:
191
191
192
192
```
193
193
# DO NOT RUN
194
-
# Render the text
195
-
output$output_text <- renderText({
196
-
input$input_text
197
-
})
194
+
# Render the text
195
+
output$output_text <- renderText({
196
+
input$input_text
197
+
})
198
198
```
199
199
200
200
Here, we are using the `renderText()` function to take the object from `textInput()` render it as output. We then take that rendering and assign it to `output$output_text` which ties back to the `textOutput()` function we had in the UI section of code.
@@ -207,7 +207,7 @@ Now that we've gone through each line, let's talk about what happens when we run
207
207
208
208
1. The input text is entered into the box created by `textInput()` and saved as `input$input_text`
209
209
2. This `input$input_text` object is sent to the server which sees that `input$input_text` is used to create the rendered text for `output$output_text`.
210
-
3. This `output$output_text` output is then sent back to the UI where it is displayed in the `textOutput()`fucntion
210
+
3. This `output$output_text` output is then sent back to the UI where it is displayed in the `textOutput()`function
211
211
212
212
The diagram below illustrates how this works.
213
213
@@ -258,6 +258,6 @@ Describe what information `input$input_text` and `output$output_text` holds.
0 commit comments