<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>R on Amit Kohli</title><link>https://www.amitkohli.com/topics/r/</link><description>Recent content in R on Amit Kohli</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>© 2026 Amit Kohli</copyright><lastBuildDate>Wed, 09 Nov 2016 01:06:19 +0000</lastBuildDate><atom:link href="https://www.amitkohli.com/topics/r/index.xml" rel="self" type="application/rss+xml"/><item><title>Pop quiz! What is this chart saying?</title><link>https://www.amitkohli.com/pop-quiz-what-is-this-chart-saying/</link><pubDate>Wed, 09 Nov 2016 01:06:19 +0000</pubDate><guid>https://www.amitkohli.com/pop-quiz-what-is-this-chart-saying/</guid><description>&lt;p&gt;I have been reading more and more about how people can&amp;rsquo;t interpret charts&amp;hellip; which kinda never occurred to me, if I&amp;rsquo;m gonna be very honest.  Anyway, it kind of made me think of actually testing people informally, to see for myself. So I&amp;rsquo;ve been doing just that: showing colleagues, friends, etc a chart that we created interactively during the &lt;a href="http://datascience-africa.org/2016/05/first-accra-r-user-meetup-success/" target="_blank" rel="noreferrer"&gt;first Accra R-Users session&lt;/a&gt; with tons of detail, and asking them to analyze it at length. The results have been staggering! I&amp;rsquo;m still trying to generalize my conclusions, but thought it would be fun to open up this test to the community, so here it goes! If you feel like sharing, post your observations in the comments section.&lt;/p&gt;</description></item><item><title>I’m leading the Accra R-User Meetups!</title><link>https://www.amitkohli.com/im-leading-the-accra-r-user-meetups/</link><pubDate>Tue, 24 May 2016 20:06:27 +0000</pubDate><guid>https://www.amitkohli.com/im-leading-the-accra-r-user-meetups/</guid><description>&lt;p&gt;I am not sure how, but I found &lt;a href="http://datascience-africa.org/" target="_blank" rel="noreferrer"&gt;Data Science Africa&lt;/a&gt;, whose mission it is to promote data science in Africa. For now, they are limited to organizing and running meetups across Africa, mostly focused on R, although there are higher albeit more ambitious targets. Anyway, since I&amp;rsquo;m in Accra, I contacted them to see if I could help in any way, and biz, baz, boom&amp;hellip; I&amp;rsquo;m now leading the Accra R-Community!  The community consists of 300+ interested people (another guy set started the meetup and it&amp;rsquo;s been gathering users sans local leadership) with varying levels of ability in R. To learn more about our meetup and our activities, please check:&lt;a href="http://www.meetup.com/Accra-R-Users-Group/" target="_blank" rel="noreferrer"&gt; http://www.meetup.com/Accra-R-Users-Group/ &lt;/a&gt;&lt;/p&gt;</description></item><item><title>Human armature from d3Network!</title><link>https://www.amitkohli.com/human-armature-from-d3network/</link><pubDate>Tue, 11 Nov 2014 00:17:06 +0000</pubDate><guid>https://www.amitkohli.com/human-armature-from-d3network/</guid><description>&lt;p&gt;So a little bit of R, a little bit of d3Network and boom! Instant interactive html human!&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;style&amp;gt;
.link {
stroke: #666;
opacity: 0.4;
stroke-width: 1.5px;
}
.node circle {
stroke: #fff;
opacity: 0.4;
stroke-width: 1.5px;
}
.node:not(:hover) .nodetext {
display: none;
}
text {
font: 7px serif;
opacity: 0.4;
pointer-events: none;
}
&amp;lt;/style&amp;gt;

&amp;lt;script src=http://d3js.org/d3.v3.min.js&amp;gt;&amp;lt;/script&amp;gt;

&amp;lt;script&amp;gt; 
 var links = [ { &amp;quot;source&amp;quot; : 0, &amp;quot;target&amp;quot; : 1, &amp;quot;value&amp;quot; : 300 }, { &amp;quot;source&amp;quot; : 1, &amp;quot;target&amp;quot; : 2, &amp;quot;value&amp;quot; : 50 }, { &amp;quot;source&amp;quot; : 1, &amp;quot;target&amp;quot; : 3, &amp;quot;value&amp;quot; : 50 }, { &amp;quot;source&amp;quot; : 2, &amp;quot;target&amp;quot; : 4, &amp;quot;value&amp;quot; : 20 }, { &amp;quot;source&amp;quot; : 3, &amp;quot;target&amp;quot; : 5, &amp;quot;value&amp;quot; : 20 }, { &amp;quot;source&amp;quot; : 4, &amp;quot;target&amp;quot; : 6, &amp;quot;value&amp;quot; : 1 }, { &amp;quot;source&amp;quot; : 5, &amp;quot;target&amp;quot; : 7, &amp;quot;value&amp;quot; : 1 }, { &amp;quot;source&amp;quot; : 8, &amp;quot;target&amp;quot; : 9, &amp;quot;value&amp;quot; : 50 }, { &amp;quot;source&amp;quot; : 9, &amp;quot;target&amp;quot; : 10, &amp;quot;value&amp;quot; : 20 }, { &amp;quot;source&amp;quot; : 9, &amp;quot;target&amp;quot; : 11, &amp;quot;value&amp;quot; : 20 }, { &amp;quot;source&amp;quot; : 10, &amp;quot;target&amp;quot; : 12, &amp;quot;value&amp;quot; : 10 }, { &amp;quot;source&amp;quot; : 11, &amp;quot;target&amp;quot; : 13, &amp;quot;value&amp;quot; : 10 }, { &amp;quot;source&amp;quot; : 12, &amp;quot;target&amp;quot; : 14, &amp;quot;value&amp;quot; : 5 }, { &amp;quot;source&amp;quot; : 13, &amp;quot;target&amp;quot; : 15, &amp;quot;value&amp;quot; : 5 }, { &amp;quot;source&amp;quot; : 2, &amp;quot;target&amp;quot; : 8, &amp;quot;value&amp;quot; : 50 }, { &amp;quot;source&amp;quot; : 3, &amp;quot;target&amp;quot; : 16, &amp;quot;value&amp;quot; : 50 }, { &amp;quot;source&amp;quot; : 1, &amp;quot;target&amp;quot; : 8, &amp;quot;value&amp;quot; : 50 }, { &amp;quot;source&amp;quot; : 1, &amp;quot;target&amp;quot; : 16, &amp;quot;value&amp;quot; : 50 }, { &amp;quot;source&amp;quot; : 8, &amp;quot;target&amp;quot; : 16, &amp;quot;value&amp;quot; : 50 }, { &amp;quot;source&amp;quot; : 16, &amp;quot;target&amp;quot; : 9, &amp;quot;value&amp;quot; : 50 } ] ; 
 var nodes = [ { &amp;quot;name&amp;quot; : &amp;quot;Head&amp;quot;, &amp;quot;group&amp;quot; : 1 }, { &amp;quot;name&amp;quot; : &amp;quot;Sternum&amp;quot;, &amp;quot;group&amp;quot; : 1 }, { &amp;quot;name&amp;quot; : &amp;quot;Shoulder.r&amp;quot;, &amp;quot;group&amp;quot; : 1 }, { &amp;quot;name&amp;quot; : &amp;quot;Shoulder.l&amp;quot;, &amp;quot;group&amp;quot; : 1 }, { &amp;quot;name&amp;quot; : &amp;quot;Elbow.r&amp;quot;, &amp;quot;group&amp;quot; : 1 }, { &amp;quot;name&amp;quot; : &amp;quot;Elbow.l&amp;quot;, &amp;quot;group&amp;quot; : 1 }, { &amp;quot;name&amp;quot; : &amp;quot;Wrist.r&amp;quot;, &amp;quot;group&amp;quot; : 1 }, { &amp;quot;name&amp;quot; : &amp;quot;Wrist.l&amp;quot;, &amp;quot;group&amp;quot; : 1 }, { &amp;quot;name&amp;quot; : &amp;quot;rib.r&amp;quot;, &amp;quot;group&amp;quot; : 1 }, { &amp;quot;name&amp;quot; : &amp;quot;hip.c&amp;quot;, &amp;quot;group&amp;quot; : 1 }, { &amp;quot;name&amp;quot; : &amp;quot;hip.r&amp;quot;, &amp;quot;group&amp;quot; : 1 }, { &amp;quot;name&amp;quot; : &amp;quot;hip.l&amp;quot;, &amp;quot;group&amp;quot; : 1 }, { &amp;quot;name&amp;quot; : &amp;quot;knee.r&amp;quot;, &amp;quot;group&amp;quot; : 1 }, { &amp;quot;name&amp;quot; : &amp;quot;knee.l&amp;quot;, &amp;quot;group&amp;quot; : 1 }, { &amp;quot;name&amp;quot; : &amp;quot;ankle.r&amp;quot;, &amp;quot;group&amp;quot; : 1 }, { &amp;quot;name&amp;quot; : &amp;quot;ankle.l&amp;quot;, &amp;quot;group&amp;quot; : 1 }, { &amp;quot;name&amp;quot; : &amp;quot;rib.l&amp;quot;, &amp;quot;group&amp;quot; : 1 } ] ; 
 var width = 900
height = 600;

var color = d3.scale.category20();

var force = d3.layout.force()
.nodes(d3.values(nodes))
.links(links)
.size([width, height])
.linkDistance(50)
.charge(-120)
.on(&amp;quot;tick&amp;quot;, tick)
.start();

var svg = d3.select(&amp;quot;body&amp;quot;).append(&amp;quot;svg&amp;quot;)
.attr(&amp;quot;width&amp;quot;, width)
.attr(&amp;quot;height&amp;quot;, height);

var link = svg.selectAll(&amp;quot;.link&amp;quot;)
.data(force.links())
.enter().append(&amp;quot;line&amp;quot;)
.attr(&amp;quot;class&amp;quot;, &amp;quot;link&amp;quot;)
.style(&amp;quot;stroke-width&amp;quot;, function(d) { return Math.sqrt(d.value); });

var node = svg.selectAll(&amp;quot;.node&amp;quot;)
.data(force.nodes())
.enter().append(&amp;quot;g&amp;quot;)
.attr(&amp;quot;class&amp;quot;, &amp;quot;node&amp;quot;)
.style(&amp;quot;fill&amp;quot;, function(d) { return color(d.group); })
.style(&amp;quot;opacity&amp;quot;, 0.4)
.on(&amp;quot;mouseover&amp;quot;, mouseover)
.on(&amp;quot;mouseout&amp;quot;, mouseout)
.call(force.drag);

node.append(&amp;quot;circle&amp;quot;)
.attr(&amp;quot;r&amp;quot;, 6)

node.append(&amp;quot;svg:text&amp;quot;)
.attr(&amp;quot;class&amp;quot;, &amp;quot;nodetext&amp;quot;)
.attr(&amp;quot;dx&amp;quot;, 12)
.attr(&amp;quot;dy&amp;quot;, &amp;quot;.35em&amp;quot;)
.text(function(d) { return d.name });

function tick() {
link
.attr(&amp;quot;x1&amp;quot;, function(d) { return d.source.x; })
.attr(&amp;quot;y1&amp;quot;, function(d) { return d.source.y; })
.attr(&amp;quot;x2&amp;quot;, function(d) { return d.target.x; })
.attr(&amp;quot;y2&amp;quot;, function(d) { return d.target.y; });

node.attr(&amp;quot;transform&amp;quot;, function(d) { return &amp;quot;translate(&amp;quot; + d.x + &amp;quot;,&amp;quot; + d.y + &amp;quot;)&amp;quot;; });
}

function mouseover() {
d3.select(this).select(&amp;quot;circle&amp;quot;).transition()
.duration(750)
.attr(&amp;quot;r&amp;quot;, 16);
d3.select(this).select(&amp;quot;text&amp;quot;).transition()
.duration(750)
.attr(&amp;quot;x&amp;quot;, 13)
.style(&amp;quot;stroke-width&amp;quot;, &amp;quot;.5px&amp;quot;)
.style(&amp;quot;font&amp;quot;, &amp;quot;17.5px serif&amp;quot;)
.style(&amp;quot;opacity&amp;quot;, 1);
}

function mouseout() {
d3.select(this).select(&amp;quot;circle&amp;quot;).transition()
.duration(750)
.attr(&amp;quot;r&amp;quot;, 8);
}

&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;</description></item><item><title>Wordcloud generator</title><link>https://www.amitkohli.com/wordcloud-generator/</link><pubDate>Mon, 18 Aug 2014 21:23:34 +0000</pubDate><guid>https://www.amitkohli.com/wordcloud-generator/</guid><description>&lt;p&gt;&lt;figure&gt;&lt;img
 class="my-0 rounded-md"
 loading="lazy"
 decoding="async"
 fetchpriority="low"
 alt=""
 src="https://www.amitkohli.com/post/2014-08-18-wordcloud-generator_files/Rploteng.png"
 &gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;Using [[Shiny]] and [[R]], we made a super-customizable wordcloud maker that takes any .txt file you feed it, and creates a wordcloud just how you like it (without needing to give your email to creepy people). &lt;a title="Wordcloud maker!" href="https://amit.shinyapps.io/WordCloudMaker/" target="_blank"&gt;Check it out!&lt;/a&gt;&lt;/p&gt;</description></item></channel></rss>