ggplot2 from Clojure

Just a quick note on how to call ggplot2 from Clojure. Install the rincanter package. A tip: if you don’t know what R_HOME is for your system, try this at the R prompt:

> R.home(component="home")
[1] "/usr/lib64/R"
>

So I did export R_HOME=/usr/lib64/R and then rincanter was happy.

When calling qplot, do not use r-eval because this tries to convert the entire plot into a Clojure object, resulting in unmanageable output. Use r-eval-raw instead.

https://gist.github.com/1124157.js

I worked out the right commands by copying one of the answers to this stackoverflow question.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s