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