RObject
RObject is a wrapper library for RSRuby.
RSRuby provide to access R functions and variables from Ruby code. And, RObject wrap RSRuby's class to appropriate RObject class.
Convert R class to RObject
numeric=>RObject::Numericvector=>RObject::Vectormatrix=>RObject::Matrixlist=>RObject::Listarray=>RObject::Arraydata.frame=>RObject::DataFramecharacter=>RObject::String- other =>
RObject::Base
Installation
Add this line to your application's Gemfile:
gem 'robject'
And then execute:
$ bundle
Or install it yourself as:
$ gem install robject
Usage
Execute robj_console to open R-console
robj_console
> m = matrix (1..9).to_a, ncol: 3
=> [[1, 4, 7], [2, 5, 8], [3, 6, 9]]
> print m * m
[,1] [,2] [,3]
[1,] 30 66 102
[2,] 36 81 126
[3,] 42 96 150
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request