Method: Rri::Engine#eval_and_convert

Defined in:
lib/rri/engine.rb

#eval_and_convert(expression) ⇒ Object

Eval expression and convert result to the corresponding ruby type

Parameters:

  • expression (String)

    the R epxression to evaluate

Returns:

  • the result converted to the corresponding ruby type

Raises:



206
207
208
209
210
# File 'lib/rri/engine.rb', line 206

def eval_and_convert(expression)
  success, value = convert_to_ruby_object(@engine.parseAndEval(expression))
  raise RriException.new("Failed to convert R object to ruby object for: #{value}") unless success
  value
end