<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Rstats on zachcp</title>
		<link>http://zachcp.org/categories/rstats/</link>
		<description>Recent content in Rstats on zachcp</description>
		<generator>Hugo</generator>
		<language>en-us</language>
		
		
		
			<copyright>© 2007- {year}</copyright>
		
		
			<lastBuildDate>Sat, 19 Mar 2016 08:03:00 +0000</lastBuildDate>
		
			<atom:link href="http://zachcp.org/categories/rstats/index.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>Chemdoodle Sketcher Gadget</title>
				<link>http://zachcp.org/blog/sketcher_gadget/</link>
				<pubDate>Sat, 19 Mar 2016 08:03:00 +0000</pubDate>
				<guid>http://zachcp.org/blog/sketcher_gadget/</guid>
				<description>&lt;p&gt;This week I put together an interactive Shiny Gadget that wraps the Chemdoodle Sketcher JS. The basic operation is as follows.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-r&#34;&gt;# install the library.&#xA;# needs rJava with Java 7 or greater. see below if difficult to install&#xA;devtools::install_github(&amp;quot;zachcp/chemdoodle&amp;quot;)&#xA;&#xA;# launches the chemdoodle sketcher and stores the resulting JSON&#xA;moljson &amp;lt;- drawMolecule()&#xA;&#xA;# processes  JSON to a CDK AtomContainer&#xA;mol &amp;lt;- processChemDoodleJson(moljson)&#xA;&#xA;# convert to SMILES&#xA;smi &amp;lt;- toSmiles(mol)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The sketcher itself looks like this:&lt;/p&gt;</description>
			</item>
			<item>
				<title>Stacked Bars</title>
				<link>http://zachcp.org/blog/stackedbarswidget/</link>
				<pubDate>Wed, 03 Feb 2016 08:03:00 +0000</pubDate>
				<guid>http://zachcp.org/blog/stackedbarswidget/</guid>
				<description>&lt;p&gt;I recently came across &lt;a href=&#34;https://twitter.com/hrbrmstr&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;@hrbrmstr&amp;rsquo;s&lt;/a&gt; &lt;a href=&#34;http://hrbrmstr.github.io/streamgraph/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;streamgraph&amp;rsquo;s&lt;/a&gt; package.&#xA;The package is nice for the manner in which it makes it easy to create streamgraphs but my interest was piqued when I notices that&#xA;were select boxes. At some point I had tried developing simple &lt;a href=&#34;http://www.htmlwidgets.org/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;HTMLwidget&lt;/a&gt; but had gotten gummed up&#xA;in my understanding of how values were being passed around. Furthermore, HTMLwidgets sanitizes your javascript so there are no global variables&#xA;left around to inspect and therefore debugging was a pain. So the streamgraphs package is interesting for providing a good&#xA;best practice on how to pass in data. Heres a few things I learned followed by a little HTMLWidgets&#xA;&lt;a href=&#34;http://zachcp.github.io/stackedbars/stackedbars.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;package I made&lt;/a&gt; that clones Mike Bostock&amp;rsquo;s &lt;a href=&#34;http://bl.ocks.org/mbostock/3886208&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;stacked bar&#xA;chart&lt;/a&gt;&lt;/p&gt;</description>
			</item>
			<item>
				<title>Small Multiples Map</title>
				<link>http://zachcp.org/blog/small-multiples-map/</link>
				<pubDate>Sun, 17 Jan 2016 08:03:00 +0000</pubDate>
				<guid>http://zachcp.org/blog/small-multiples-map/</guid>
				<description>&lt;p&gt;Despite using R and its various graphing facilities I have somehow managed not to have stumbled across&#xA;&lt;a href=&#34;http://rud.is/b/about/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Bob&lt;/a&gt; &lt;a href=&#34;https://twitter.com/hrbrmstr&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Rudis&lt;/a&gt;. I recently noticed his &lt;a href=&#34;https://cran.r-project.org/web/packages/ggalt/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;ggalt&lt;/a&gt; package which has some similarities overlap to stuff I have tried to do in &lt;a href=&#34;https://github.com/zachcp/phylogeo&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;phylogeo&lt;/a&gt;.  This inspired me to give a quick whirl to the small-multiples style of charts, of which the following is a small, reproducible example. When put into combination with the updated projections and higher-res mapdata of the [maps package] (&lt;a href=&#34;https://cran.r-project.org/web/packages/maps/README.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;https://cran.r-project.org/web/packages/maps/README.html&lt;/a&gt;): (natural earth 1:50m.)&lt;/p&gt;</description>
			</item>
			<item>
				<title>NCI60-Drug-Toxicity</title>
				<link>http://zachcp.org/blog/nci60-drug-toxicity/</link>
				<pubDate>Tue, 12 May 2015 08:03:00 +0000</pubDate>
				<guid>http://zachcp.org/blog/nci60-drug-toxicity/</guid>
				<description>&lt;p&gt;The National Cancer Institute provides a number of datasets that are freely available for download. One of these,&#xA;the NCI60 &lt;a href=&#34;http://www.discover.nci.nih.gov/cellminer/loadDownload.do&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Compound Activity&lt;/a&gt; dataset assesses the growth&#xA;inhibition caused by a large number of compounds on  60 cancer cell lines (the NCI60 cell lines).&#xA;To play with this data, I created an R package that will allow you to peruse this &lt;a href=&#34;https://github.com/zachcp/nci60-drugtox&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;data set&lt;/a&gt; and ask some basic questions. My intention is to write up a few blog posts about this dataset - basically writing up some exploratory data analysis.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Rmd for Static Sites</title>
				<link>http://zachcp.org/blog/blogging-with-rmd/</link>
				<pubDate>Mon, 11 May 2015 08:03:00 +0000</pubDate>
				<guid>http://zachcp.org/blog/blogging-with-rmd/</guid>
				<description>&lt;p&gt;R markdown and knitr are powerful ways to render reproducible R workflows, however,&#xA;if you want to use Rmd files in your blog there is a bit of plumbing you will need to put do.&lt;/p&gt;&#xA;&lt;p&gt;Lets say you have something like the following setup where your root&#xA;directory has a &lt;code&gt;Makefile&lt;/code&gt; and you have subfolders representing static content&#xA;and blog content. If you are using a static blog generator like I am (see &lt;a href=&#34;http://gohugo.io/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Hugo&lt;/a&gt;),&#xA;the static generator will genrate slugs, organise tags andtemplates and so on. Therefore,&#xA;unlike the traditional Rstudio-based Rmarkdown workflow where HTML is output, it is preferable to&#xA;generate the Markdown file and image files and incorporating those into your static blog generator&#xA;workflow. The following solution uses a Makefile to control the conversion of &lt;strong&gt;Rmd-&amp;gt;Md&lt;/strong&gt;. The &lt;code&gt;knitr&lt;/code&gt; package&#xA;will then need to be used to correctly place the image files in the appropriate folder&#xA;and to link image &lt;strong&gt;src=&amp;quot;&amp;quot;&lt;/strong&gt; to the correct locations by invoking the &lt;code&gt;opt_knit$set()&lt;/code&gt;&#xA;and setting the appropriate values.&lt;/p&gt;</description>
			</item>
	</channel>
</rss>
