Publications by klr
Responsive SVG in Your RStudio Browser
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
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
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
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
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
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
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
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
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
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