Cannot use shiny in Rmarkdown

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

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.

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

The issue is with the newest version of the rmarkdown package:

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.

Thanks. Installing former package of rmarkdown solved the problem.