Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

67 lines (43 sloc) 1.551 kb

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.

Jump to Line
Something went wrong with that request. Please try again.