From: "M. Edward (Ed) Borasky" Date: 2006-10-16T14:50:01+09:00 Subject: Re: [ANN] RSRuby 0.4 ara.t.howard@noaa.gov wrote: > On Mon, 16 Oct 2006, Alex Gutteridge wrote: > >> Hi All, >> >> I have released a new version of RSRuby on rubyforge today: >> >> http://rubyforge.org/projects/rsruby/ >> >> RSRuby allows the user to embed a full R interpreter into a Ruby >> script. This allows the script to call any R function and convert the >> result back into Ruby. From the R website: 'R is a free software >> environment for statistical computing and graphics.'. Running a >> students t-test (or any other R function) is as simple as: >> >> require 'rsruby' >> r=RSRuby.instance #Create R interpreter >> ttest = r.t_test([1,2,3]) #Convert [1,2,3] to R. Run t.test >> function and convert result back to Ruby >> puts ttest['p.value'] #Prints out p.value statistic from the >> ttest object >> >> In this new release, the whole codebase has been moved over to an RPy >> (http://rpy.sourceforge.net/) derived core, which has resulted in some >> changes and new features as well as improved stability. Documentation >> is still patchy, though there are some examples included in the >> release and an almost complete conversion of the RPy test suite. A >> better manual/tutorial is on my list of things for the next release, >> until then the RPy manual may help. >> >> Dr Alex Gutteridge >> Post-Doctoral Researcher >> >> Bioinformatics Center >> Institute for Chemical Research >> Kyoto University >> Gokasho, Uji, Kyoto 611-0011 >> Japan > > insanely cool stuff alex! > > -a Yeah ... maybe this will save me the trouble of getting the SWIG stuff working. Actually, though, I have been able to build a SWIG-wrapped R shared library, after about a week of wrestling with the header files, but I haven't had a chance to try out any test cases, so I have no idea what it will do. In the long run, I think I still want to do the SWIG wrapping, because, at least for simple libraries, it's scripting-language agnostic. You do one set of interface files and you can access your library from Ruby, Python, Perl, PHP (4), a couple of Schemes, Lua, Pike (whatever *that* is), Java and one variant of Common Lisp (clisp IIRC). Incidentally, my version of R also builds a shared LAPACK. I think it's the FORTRAN-callable version, though, not the C-callable version. I haven't been able to find a full Ruby/LAPACK interface. There's a piece of it in the Ruby GSL package, and another version in something called "linalg". I haven't been able to get "linalg" to build, though.