<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>P5 on E. Visel</title>
    <link>/tags/p5/</link>
    <description>Recent content in P5 on E. Visel</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Fri, 23 Mar 2018 00:00:00 +0000</lastBuildDate>
    
	<atom:link href="/tags/p5/index.xml" rel="self" type="application/rss+xml" />
    
    
    <item>
      <title>p5 in R</title>
      <link>/blog/p5-in-r/</link>
      <pubDate>Fri, 23 Mar 2018 00:00:00 +0000</pubDate>
      
      <guid>/blog/p5-in-r/</guid>
      <description>p5.js is a version of Processing built natively in JavaScript. It’s really, really awesome.
Sean Kross wrote R bindings for p5.js in his p5 package so it can be written and R and published as an htmlwidget. This is a little exploration of how it works.
library(p5) # runs once at start setup_ &amp;lt;- setup() %&amp;gt;% createCanvas(500, 500) %&amp;gt;% noStroke() # reruns every frame draw_ &amp;lt;- draw() %&amp;gt;% background(&amp;#39;#888&amp;#39;) %&amp;gt;% fill(rgb(1, 1, 1, 0.</description>
    </item>
    
  </channel>
</rss>