Shiny in Rmd documents

Hi! I was wondering how to get a shiny app inside a R chunk in a regular Rmd document.
Where can I find info about it? If this is not possible, I wonder if it is to add the app remotely (I have it hosted in Thanks for your help.


You can use shiny inside of a .Rmd, as shown here,
and you can also embed full shiny applications as shown here.

Thanks, however, the Rmd document needs to be hosted in shinyapps io in order for the app to be functional, right? I mean, I have an app in shinyapps io that I want to have in a Rmd html.
I read that include_url and include_app are functions that can be used to retrieve an app and make it work inside an iframe in the Rmd. However, when I use this, I only see an empty frame unless the Rmd is hosted in shinyapps io (which defeats the purpose of using include_url, as I can basically include the app directly and not the url of it).