You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: lib/rinruby.rb
+26-27
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
#
3
3
#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.
4
4
#
5
-
#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.
5
+
#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.
6
6
#
7
7
#<b>Code</b>:
8
8
#
@@ -34,6 +34,7 @@
34
34
#
35
35
#Coded by:: David B. Dahl
36
36
#Documented by:: David B. Dahl & Scott Crawford
37
+
#Maintained by:: Claudio Bustos
37
38
#Copyright:: 2005-2009
38
39
#Web page:: http://rinruby.ddahl.org
39
40
#E-mail:: mailto:rinruby@ddahl.org
@@ -58,21 +59,19 @@
58
59
#The files "java" and "readline" are used when available to add functionality.
59
60
require'matrix'
60
61
classRinRuby
61
-
62
+
62
63
require'socket'
63
64
64
-
65
65
VERSION='2.0.3'
66
66
67
-
68
67
attr_reader:interactive
69
68
attr_reader:readline
70
69
# Exception for closed engine
71
70
EngineClosed=Class.new(Exception)
72
71
# Parse error
73
72
ParseError=Class.new(Exception)
74
-
75
-
73
+
74
+
76
75
#RinRuby is invoked within a Ruby script (or the interactive "irb" prompt denoted >>) using:
#The quit method will properly close the bridge between Ruby and R, freeing up system resources. This method does not need to be run when a Ruby script ends.
0 commit comments