<?xml version='1.0'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:atom="http://www.w3.org/2005/Atom" >
<channel>
	<title><![CDATA[BOL: R script to covert and export html page to png]]></title>
	<link>https://bioinformaticsonline.com/snippets/view/44260/r-script-to-covert-and-export-html-page-to-png?</link>
	<atom:link href="https://bioinformaticsonline.com/snippets/view/44260/r-script-to-covert-and-export-html-page-to-png?" rel="self" type="application/rss+xml" />
	<description><![CDATA[]]></description>
	
	<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/44260/r-script-to-covert-and-export-html-page-to-png</guid>
	<pubDate>Tue, 14 Mar 2023 07:03:42 -0500</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/44260/r-script-to-covert-and-export-html-page-to-png</link>
	<title><![CDATA[R script to covert and export html page to png]]></title>
	<description><![CDATA[<code># Library
library(streamgraph)
# Create data:
data &lt;- data.frame(
  year=rep(seq(1990,2016) , each=10),
  name=rep(letters[1:10] , 27),
  value=sample( seq(0,1,0.0001) , 270)
)
# Start with a classic stream graph. It is supposed to open in a browser
streamgraph(data, key=&quot;name&quot;, value=&quot;value&quot;, date=&quot;year&quot;)
# Copy the URL of the html window you get
# load webshot library
library(webshot)

#install phantom:
webshot::install_phantomjs()
# Make a webshot in pdf : high quality but can not choose printed zone
webshot(&quot;paste_your_html_here.html&quot; , &quot;output.pdf&quot;, delay = 0.2)

# Make a webshot in png : Low quality - but you can choose shape
webshot(&quot;paste_your_html_here&quot; , &quot;output.png&quot;, delay = 0.2 , cliprect = c(440, 0, 1000, 10))</code>]]></description>
	<dc:creator>BioStar</dc:creator>
</item>

</channel>
</rss>