rsruby with rails

M

Matteo Zandi

Hi,

I'd like to call R from a rails application. I already installed rsruby
and works fine with irb, but how do I call it from rails?

I have created config/evironments/rsruby_environment.rb like so:

require 'rsruby'
module R_Config

R = RSRuby.instance

end

then added it to config/environments.rb:

...
# Include your application configuration below

# rsruby-Configuration
require 'environments/rsruby_environment.rb'
require 'rsruby'

inserted in a controller like so:

r = R_Config::R
@r_pnorm = r.pnorm(0.1)

and finally called in a view

<%= @r_pnorm %>

Is that correct? What is wrong?

Thanks,
Matteo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,269
Messages
2,571,338
Members
48,025
Latest member
Rigor4

Latest Threads

Top