Cannot use shiny in Rmarkdown

rmarkdown
shiny

#1

I have some trouble in using Shiny in Rmarkdown.

It seems my Shiny does not generate variale input at all.

Here is the code:

numericInput("rows", "How many cars?", 5)

renderTable({
  head(cars, input$rows)
})

2


#2

Your question was answered on Stackoverflow:

https://stackoverflow.com/questions/47270427/object-input-not-found-in-shiny-in-rmarkdown

You might want to investigate updating your shiny and rmarkdown pacakages.


#3

I tired and installed those packages again and again. Same error…


#4

The issue is with the newest version of the rmarkdown package:
https://github.com/rstudio/rmarkdown/issues/1193

If you install the development version, the problem should go away:

if (!require("devtools")) install.packages("devtools")
devtools::install_github("rstudio/rmarkdown")

If you don’t want to go that route, it looks like they expect to release the patch to CRAN fairly soon.


#5

Thanks. Installing former package of rmarkdown solved the problem.