Skip to content

Commit a0a70cb

Browse files
committed
First git of RinRuby (1.2.0)
0 parents  commit a0a70cb

File tree

9 files changed

+1632
-0
lines changed

9 files changed

+1632
-0
lines changed

History.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
=== 1.2.0 / 2010-05-23
2+
3+
* Fixed to works on Ruby 1.9
4+
* Pull and push of Matrixes
5+
* Faster implementation using functions on R sended at beginning of session
6+
* Regression tests and specifications via RSpec
7+
8+
=== 1.1.1 / 2008
9+
10+
* Last official version on RubyForge
11+

LICENSE.txt

Lines changed: 646 additions & 0 deletions
Large diffs are not rendered by default.

Manifest.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
History.txt
2+
LICENSE.txt
3+
Manifest.txt
4+
README.txt
5+
Rakefile
6+
lib/rinruby.rb
7+
spec/rinruby_spec.rb
8+
spec/spec.opts
9+
spec/spec_helper.rb

README.txt

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
= rinruby
2+
3+
* http://rinruby.ddahl.org/
4+
5+
== DESCRIPTION:
6+
7+
RinRuby is a Ruby library that integrates the R interpreter in Ruby, making R's statistical routines and graphics available within Ruby. The library consists of a single Ruby script that is simple to install and does not require any special compilation or installation of R. Since the library is 100% pure Ruby, it works on a variety of operating systems, Ruby implementations, and versions of R. RinRuby's methods are simple, making for readable code. The {website [rinruby.ddahl.org]}[http://rinruby.ddahl.org] describes RinRuby usage, provides comprehensive documentation, gives several examples, and discusses RinRuby's implementation.
8+
9+
10+
== FEATURES/PROBLEMS:
11+
12+
* Pure Ruby. Works on Ruby 1.8.7, 1.9 and JRuby 1.4
13+
* Slower than RSRuby, but more robuts
14+
15+
== SYNOPSIS:
16+
Below is a simple example of RinRuby usage for simple linear regression. The simulation parameters are defined in Ruby, computations are performed in R, and Ruby reports the results. In a more elaborate application, the simulation parameter might come from input from a graphical user interface, the statistical analysis might be more involved, and the results might be an HTML page or PDF report.
17+
18+
<b>Code</b>:
19+
20+
require "rinruby"
21+
n = 10
22+
beta_0 = 1
23+
beta_1 = 0.25
24+
alpha = 0.05
25+
seed = 23423
26+
R.x = (1..n).entries
27+
R.eval <<EOF
28+
set.seed({seed})
29+
y <- {beta_0} + {beta_1}*x + rnorm({n})
30+
fit <- lm( y ~ x )
31+
est <- round(coef(fit),3)
32+
pvalue <- summary(fit)$coefficients[2,4]
33+
EOF
34+
puts "E(y|x) ~= {R.est[0]} + {R.est[1]} * x"
35+
if R.pvalue < alpha
36+
puts "Reject the null hypothesis and conclude that x and y are related."
37+
else
38+
puts "There is insufficient evidence to conclude that x and y are related."
39+
end
40+
41+
<b>Output</b>:
42+
43+
E(y|x) ~= 1.264 + 0.273 * x
44+
Reject the null hypothesis and conclude that x and y are related.
45+
46+
== REQUIREMENTS:
47+
48+
* R
49+
50+
== INSTALL:
51+
52+
* sudo gem install rinruby
53+
54+
55+
== LICENSE:
56+
57+
GPL-3. See LICENSE.txt for more information.
58+

Rakefile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/ruby
2+
# -*- ruby -*-
3+
# -*- coding: utf-8 -*-
4+
$:.unshift(File.dirname(__FILE__)+'/lib/')
5+
require 'rubygems'
6+
require 'hoe'
7+
require './lib/rinruby'
8+
9+
Hoe.plugin :git
10+
11+
Hoe.spec 'rinruby' do
12+
self.testlib=:rspec
13+
self.version=RinRuby::VERSION
14+
# self.rubyforge_name = 'rinruby' # if different than 'rinruby2'
15+
self.developer('David Dahl', 'rinruby_AT_ddahl.org')
16+
self.developer('Claudio Bustos', 'clbustos_AT_gmail.com')
17+
self.url = "http://rinruby.ddahl.org/"
18+
19+
end
20+
21+
# vim: syntax=ruby

0 commit comments

Comments
 (0)