Publications by klr

Responsive SVG in Your RStudio Browser

08.10.2014

For those readers who are unaware, SVG is absolutely amazing, and if you need some convincing see this 2009 paper/talk from David Dailey Why is SVG Going to Be REALLY BIG?  Most R users should be very well acquainted with graphics and plots magically appearing on the screen with certain commands.  These graphics though are rasters, ...

812 sym

SVG + a little extra (d3.js) in RStudio Browser | No Pipes This Time

09.10.2014

I’m guessing here, but yesterday’s post Responsive SVG in Your RStudio Browser might have inspired some “but,…)”s, “yes plus I need”s, “what the %>>% with the pipe”s, etc.  I’ll attempt to address a couple of these in this quick post. First, if you don’t like pipes, here is the non-piped version of the code.  I...

840 sym

SVG + Javascript Ekholm Decomposition in RStudio Browser

10.10.2014

Our topics this week seem unrelated, but in an effort to bridge the two another random project – make website in R for these SVGs of Portland Vector Bridges result: Portland Bridges in SVGcode: R to make simple siteEkholm decomposition SelectionShare & TimingShare | Masterfully Written by Delightfully Responsive Author Popular Mutu...

808 sym

Postive Feedback in R with a Little Javascript

22.10.2014

Let’s face it, sometimes the struggle in R can become frustrating, depressing, daunting, or just monotonous.  For those moments when you need a little positive feedback, some encouragement, or a pat on the back, I thought this might help.  Maybe I should make this into a package. I found this from Sweet Alert for Bootstrap forked from Tris...

910 sym R (717 sym/1 pcs) 2 img

Update on JGBs versus USTs

05.11.2014

Given the recent selloff in the Yen, I thought now would be a good time to update my favorite chart from Intended or Unintended Consequences. For a true currency death spiral, rates need to move up rather than down.  It appears we are long way from that. Long-time readers will know that I have been keenly interested in the Yen for t...

786 sym

Pipeline to Plot Annual % Change

24.11.2014

Pipes in R make my life incredibly easy, and I think my code easier to read.   Note, there are a couple different flavors of pipes (see magrittr and pipeR).  For now, I choose pipeR.library(quantmod)library(pipeR)library(ggplot2)getSymbols(“^GSPC”,from=”1900-01-01″,auto.assign=F) %>>% #get S&P 500 from Yahoo!Finance ( .[e...

812 sym

Secret to Making Things Appear in RStudio Viewer

24.11.2014

I am by no means an authoritative source on this, but I think I found out the secret behind htmltools html_print that chooses the RStudio Viewer browser rather than your default browser like utils::browseURL. Here is a quick code snippet that hopefully explains what is happening. It appears you just need a temp directory with the patt...

811 sym

Slightly Advanced rvest with Help from htmltools + XML + pipeR

26.11.2014

Hadley Wickham’s post “rvest: easy web scraping with R” introduces the fine new package rvest very well.  For those now yearning a slightly more advanced example with a little help from pipeR + htmltools + XML, I thought this might fill your yearn.  The code grabs css information running the fancy new site cssstats.com on my b...

805 sym

Happy Thanksgiving | More Examples of XML + rvest with SVG

26.11.2014

I did not intend for this little experiment to become a post, but I think the code builds nicely on the XML + rvest combination (also see yesterday’s post) for working with XML/HTML/SVG documents in R. It all started when I was playing on my iPhone in the Sketchbook app and drew a really bad turkey.  Even though, the turkey was bad...

810 sym

Much Better Animated Paths | Christmas SVG

02.12.2014

Just after I made my really ugly animated turkey sketch (see post), I saw this much better set of Christmas icons in the Smashing Magazine Article Freebie Christmas Icon Set from Manuela Langella.  While I still remember how to do this, I thought I would use the same techniques in R using rvest + XML + htmltools to animate the paths ...

811 sym