Placing a flexdashboard inside a iframe

I would like to understand can I publish flexdashboard using an iframe that could be embed in the website . Or if there is any other option to embed flexdashboards to the website


Can someone help me understand how can I embed the published flexdashboard using an iframe.

Hi @Swapna is your flexdashboard using shiny? If so, it should be stated in the header (runtime: shiny).
This is important since if this is the case you would need an environment where you can run the shiny code.
If not, you can just knit the flexdashboard to html and use that for your iframe.
See also

@ginberg Thanks for replying.
I am working with static flexdashboard. I have placed the below code in markdown code

l<-leaflet() %>% addTiles()

Please let me know if this is the correct method to use my flexdashboard inside a iframe

should i add anything else in the code. Please let me know


@Swapna I have understood your question differently: I thought you wanted to embed the whole flexdashboard into another website using iframe. But you just want to have the leaflet in an iframe?
You can save the whole dashboard to html using rmarkdown::render("my_dashboard.Rmd")

Anyway, does your approach work for you?

Can you please tell me where should i use this command in the flexdashboard rmarkdown::render("my_dashboard.Rmd")
How can I save the whole dashboard to html using above command

You can run this command from the Console in RStudio

When i run the above code rmarkdown::render() it says file not exist

So just help me to understand that using the above code can I publish using Rstudio connect the flexdashboard to a HTML document which can be embedded into an Iframe


After you have rendered your Rmd to an html file using rmarkdown::render, you can include it in an iframe like this:
<iframe src="my_flexdashboard.html" height="200" width="300" title="my flexdashboard"></iframe>

Thanks I could render my Rmd file to Html using
rmarkdown::render(input="~/Flexdashboard/Flex_forecast.Rmd",output_file = "forecast.html",output_format ="flex_dashboard"). Now I need to check if I could include in an Iframe

Thanks for all the help

1 Like

@ginberg I would also like to understand If I automate the publishing of my flexdashboard using schedule of RStudio connect then how can I automate rmarkdown::render() each time to generate the updated HTML file.
Because the URL for the html file takes the port of Rserver i.e 8787 below is the link
whereas Rstudio connect takes the port 3939
Please help me to understand this

Can you please help me understand the above post.

You are asking a very different question, to get the attention you need it would be better if you ask it on a new topic under the #r-admin:rstudio-connect category.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.