Forums | Admin

Discussion Forums: help

Start New Thread Start New Thread

 

By: Alex Gutteridge
RE: Accessing R packages through RSRuby [ reply ]  
2009-06-15 08:19
It's just a normal Ruby Hash, so to get 'statistic' you'd write:

r.kripp_alpha(m)['statistic']

AlexG

By: Dhairya Dand
RE: Accessing R packages through RSRuby [ reply ]  
2009-06-13 13:41
Hello Johnny,

Yes that definitely helped and now I am able to pass matrices as parameters to the function- I still have one more question though -

This is the way I do it -


require "rubygems"
require 'rsruby'

r = RSRuby.instance
r.library("concord")
r.matrix.autoconvert(RSRuby::NO_CONVERSION)
m = r.matrix([1,2,3,4],:nrow=>2,:ncol=>2)
puts r.is_matrix(m)
r.kripp_alpha(m)


Now the result it returns is of the form -

irb(main):009:0> r.kripp_alpha(m)
=> {"nmatchval"=>4.0, "data.level"=>"nominal", "coincidence.matrix"=>[[0.0, 0.0, 1.0], [0.0, 0.0, 1.0], [1.0, 1.0, 0.0]], "data.values"=>["2", "3", "4"], "statistic"=>-0.2}

The answer is the one in the 'statistic' variable. I would like to ask, how can I access this value in my rails application to display it?

Thanks !

By: Johnny Nguyen
RE: Accessing R packages through RSRuby [ reply ]  
2009-06-08 13:25
What happens when you do:

R=RSRuby.instance
R.library("concord")
R.kripp_alpha( parameters )

By: Dhairya Dand
Accessing R packages through RSRuby [ reply ]  
2009-06-08 11:42
How does one access R packages through RSRuby, I wanted to access the kripp.alpha function in the Concord Package, I have installed the package as well as set Concord to load as a default package, I have tested the function through R and it runs just fine.

However under RSRuby it says 'variable kripp.alpha not found' I am using -

R=RSRuby.instance
R.kripp_alpha( parameters )

Could you please point out any mistake or suggest ?

Thanks a lot !