showing saved HTML plots in Shiny - r

I have a lot of plots saved in a folder and their format is *.html so they could be easily viewed in a browser. Plots were made using plotly in R. I want to build a Shiny app to view these saved files. Does anyone know how to read and view these files into Shiny?
I know the other alternative is to plot on demand in Shiny, but due to the large number of data points and time to generate plots, I want to use the saved files. I appreciate your help.

Related

Export Plots in R to Existing Pdf without Overwriting

I have two separate scripts that each outputs a large number of plots. I can set the parameters for the plots but I can not easily combine the scripts. I'd like for all the plots to be saved into the same pdf (or tiff, or png, whatever works) in a way that on each page I have 1 figure from script 1 and 1 figure from script 2. My thinking is that I'll have script 1 to output the figures on the left side of the pages, saving space for script 2. Then in script 2, if I can somehow have the plots exported to the same file, only on the right side of the pages WITHOUT overwriting the existing plots. Any help will be greatly appreciated!
I'm also open to other apps that can automatically combine existing pdfs in this way because I actually have already made the plots separately.
TIA

save 3d graph to multiple format

I currently have a 3d graph and I would like to save the output in both png and pdf. Is there a way to save it in those format at the same time? I know there is a ggplot function that can save plot but I'm not sure how in base r.
As far as I know you will need at least 2 lines of code, if this is what you mean. I like to use the dev.print() function to save graphics. The function is saving a copy of the plot your are currently looking at. Please note that dev.print() copy the interactive window and not directly the plot as it is specified in the help section.
dev.print() example:
dev.print(png, "yourfile.png")
dev.print(pdf, "yourfile.pdf")
To know where your file is saved you can also get and set your working directory with those 2 functions :
getwd() and setwd()
You can also use the png() and pdf() functions to save plot specifically in those format.
Your question is probably a duplicate tho.

Rasterize plot when using PDF output device

Hello everybody out there using R,
When putting multiple plots with thousands of data points into a single PDF file, this file can get huge and take a long time to open.
The following post describes exactly the same problem in Matplotlib, as well as a nice fix for it:
Matplotlib: multipage PDF with rasterized plots
Particularly nice about it is, that it only rasterizes the points without rasterizing the labels.
http://www.astrobetter.com/blog/2014/01/17/slim-down-your-bloated-graphics/ contains a nice example of it.
I am now looking for a similar solution in R.

Interactive plots on local .html via .rmd or Shiny

I'm trying to build a .html file via RStudio in to have following function(simplified).
plot1:a simple time series plot of $y_t$, where user can manually pull/drag each dot to change it's values a each time point.
plot2:a time series dependent on $y_t$, such as $f(y_t)=2*y_t+1$, once the value in plot1 changed, the plot2 will also change accordingly.
I want the .html self contained, not cloud based. I'm thinking of plotly, shininy/knitr, but I'm not sure if I'm in the direction or how to connect the dots. Hope anyone can point me to the right direction.
A self-contained/client-side html report sounds well-suited for flexdashboard. It's based on R Markdown, and therefore can accommodate Shiny elements.
I don't know if you can modify values with a mouse, but you can certainly modify values with sliders and other inputs, as well as have a second plot react to a first plot.
You may see some more possibilities in the gallery.

How to download shiny graph in PDF Formart

I am new to R programming. I have developed a shiny dashboard application for different visualization purposes where I am plotting various graphs with the help of renderDataTable, renderPlot, renderRpivotTable, renderImage renderInfoBox.
But I am unable to figure out what is the best way to download these graphs/charts/table/infobox in PDF format.
So for I am rendering Rmarkdown within downloadHandler to achieve this requirement. But It is not working for every plot such renderInfoBox,renderDataTable. I will highly appreciate any inputs on this.

Resources