Lol, oops I had a typo in my post (fixed it!) - that part is working for me, but when I try to access input1 via input$input1 it says object input not found? This is Very Likely because I don't fully understand how shiny objects work in a R Markdown document. The task I am trying to do is take the input from a shiny input and save it to a data frame (and send that data frame to somewhere like DropBox).
In shiny I'd do this:
library(shiny)
ui <- fluidPage(
titlePanel("Example"),
sidebarLayout(
sidebarPanel(
radioButtons("input1", "This is an input", choices = c( "Yes", "No"))
)
)
)
server <- function(input, output) {
observe({
d <- data.frame(test = input$input1)
write.csv(d, "test.csv")
})
}
shinyApp(ui = ui, server = server)
Right now I have this (which doesn't work
)
```
---
output:
learnr::tutorial:
progressive: true
allow_skip: true
runtime: shiny_prerendered
---
```{r}
library(shiny)
```
```{r}
radioButtons("input1", "This is an input", choices = c( "Yes", "No"))
```
```{r}
observe({
d <- data.frame(test = input$input1)
write.csv(d, "test.csv")
})
```