Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Eruby templates for plots in R

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 data
Octocat-spinner-32 templates
Octocat-spinner-32 README.textile
Octocat-spinner-32 histogram.rb
Octocat-spinner-32 logloghist.rb
Octocat-spinner-32 monthseries.rb
Octocat-spinner-32 worldmap.rb
Octocat-spinner-32 xyplot.rb
README.textile

Rplots

A collection of erubis templates for plotting with R and ruby.

Pre-requisites

You’ll need to install R:


# ubuntu
sudo apt-get install R

For mac os x try: http://cran.r-project.org/bin/macosx/. If the mac installer doesn’t already, symlink the Rscript executable to /usr/bin/Rscript.

Once R is installed, install ggplot2.


Rprompt$: install.packages("ggplot2")

Examples

Provided are some examples of using the templates with Swineherd. All examples make use of the configliere gem, thus using --help as an option should print options specific to that plot example.

XY plot


./xyplot.rb --points --width=800 --title="Henon Map" --point_size=0.01 data/henon.tsv

Histogram


./histogram.rb data/frequency.tsv

Log-Log Histogram


./logloghist.rb data/frequency.tsv

World Map


./worldmap.rb --lat=2 --lon=3 data/airports.tsv

Timeseries with Months

Often it is the case you’ve got timeseries of the form:


 201006 1234
 201007 5678
 ...

This transforms the month field into something R can understand and plots it with the right scaling.


./monthseries.rb --month=2 --y=3 --xlab="Month" --ylab="Passengers in + Passengers out" data/passengers_in_out_lax_airpt.tsv

More are on the way.

Something went wrong with that request. Please try again.