Class: R::Language
- Includes:
- BinaryOperators, ExpBinOp, IndexedObject, LogicalOperators
- Defined in:
- lib/R_interface/rlanguage.rb
Instance Attribute Summary collapse
-
#expression ⇒ Object
Returns the value of attribute expression.
Attributes inherited from Object
Class Method Summary collapse
-
.build(function_name, *args) ⇒ Object
————————————————————————————– Builds a call functions with the given arguments.
-
.to_expression(obj) ⇒ Object
————————————————————————————–.
Instance Method Summary collapse
-
#assign(expression) ⇒ Object
————————————————————————————–.
-
#i ⇒ Object
————————————————————————————–.
Methods included from IndexedObject
Methods included from ExpBinOp
Methods included from LogicalOperators
Methods included from BinaryOperators
#!=, #%, #*, #**, #+, #-, #/, #<, #<=, #>, #>=, #eq, #int_div, #til
Methods inherited from Object
#==, #_, #attr=, #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 Attribute Details
#expression ⇒ Object
Returns the value of attribute expression.
32 33 34 |
# File 'lib/R_interface/rlanguage.rb', line 32 def expression @expression end |
Class Method Details
.build(function_name, *args) ⇒ Object
Builds a call functions with the given arguments.
50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/R_interface/rlanguage.rb', line 50 def self.build(function_name, *args) res = R::Language.new( R::Support.eval("as.call"). call(R::Support.parse2list( R::Support.eval(function_name), *args) )) res.expression = "#{Language.to_expression(args[0])} #{function_name.delete("`")} #{Language.to_expression(args[1])}" res end |
.to_expression(obj) ⇒ Object
38 39 40 |
# File 'lib/R_interface/rlanguage.rb', line 38 def self.to_expression(obj) obj.respond_to?(:expression) ? obj.expression : obj.to_s end |