Class: R::Matrix

Inherits:
Object show all
Includes:
BinaryOperators, ExecBinOp, ExecUniOp, LogicalOperators, MDIndexedObject, UnaryOperators
Defined in:
lib/R_interface/rmatrix.rb

Overview



Instance Attribute Summary

Attributes inherited from Object

#r_interop, #statement

Instance Method Summary collapse

Methods included from LogicalOperators

#&, #|

Methods included from ExecUniOp

#exec_uni_oper

Methods included from UnaryOperators

#!, #+@, #-@

Methods included from ExecBinOp

#coerce, #exec_bin_oper

Methods included from BinaryOperators

#!=, #%, #*, #**, #+, #-, #/, #<, #<=, #>, #>=, #eq, #int_div, #til

Methods included from MDIndexedObject

#[]

Methods inherited from Object

#==, #_, #attr=, build, #comment, #comment=, #dim, #dim=, #dimnames, #dimnames=, #eql, #initialize, #method_missing, #names, #names=, #pp, #pretty_print, #rclass, #rclass=, #row__names, #row__names=, #setR, #setR_name, #to_s, #tsp, #tsp=

Constructor Details

This class inherits a constructor from R::Object

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class R::Object

Instance Method Details

#>>(index) ⇒ Object


When indexing with ‘[’ or ‘[[’ an R object is returned. Sometimes we need to have access to an umboxed Ruby element, for instance, in an numeric array, we might want to receive the actual number that can be used in a Ruby method. In this case, we use the ‘<<’ operator.


Returns:

  • the Ruby element at the given index in the vector



51
52
53
# File 'lib/R_interface/rmatrix.rb', line 51

def >>(index)
  @r_interop[index]
end