Project

rosar

0.0
No commit activity in last 3 years
No release in over 3 years
Ruby/GNU-R interface that uses OSA under OS X, compatible with Ruby 1.9.x.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

>= 0.6.2
 Project Readme

RosaR

Ruby/OSA to Gnu-R interface, useful to plot and analyze data from within ruby. It relies on AppleScript, so only works on Apple OS X (Snow Leopard tested).

Installation

RosaR gem has moved to Gemcutter. In order to install you have two alternative choices:

  1. Simply add the Gemcutter repo to your rubygem source list:

     gem sources -a http://gemcutter.org
    
  2. Install gemcutter:

     sudo gem install gemcutter
     sudo gem tumble
    

Next, simply install the gem:

sudo gem install rosar

Example

require '../lib/rosar'

r = ROSAR.instance

df = {
  :x => (0..4).to_a,
  :y => [7,2,5.5,8,9,10]
}
cols = %w(red green blue darkred darkgreen darkblue)
r.transfer :p=>(0...100).to_a
r.plot :x=>:p, :y=>"p^2", :typ=>"'l'"
2.upto 7 do |i|
  r.lines :x=>:p, :y=>"#{i}*p^2", :col=>"'#{cols[i-2]}'"
end
sleep(2)
r.data_frame :df, df
r.attach :df
r.plot :x=>:x, :y=>"y/2", :typ=>"'b'", :col=>"'darkred'", :xlab=>"'Time (s)'"
r.grid
r.abline :h=>[2.5,3.5]
r.abline "a=0, b=1"
r.detach :df