Class: Renjin::RubySexp
Direct Known Subclasses
Instance Attribute Summary
Attributes included from RBSexp
Class Method Summary (collapse)
-
+ (Object) build(sexp)
----------------------------------------------------------------------------------------.
Instance Method Summary (collapse)
-
- (Object) fassign(function, value)
----------------------------------------------------------------------------------------.
-
- (RubySexp) initialize(sexp)
constructor
----------------------------------------------------------------------------------------.
-
- (Object) to_string
----------------------------------------------------------------------------------------.
Methods included from RBSexp
#destroy, #ncol, #nrow, #pp, #print, #r, #rclass, #sexp?, #typeof, #unbind
Constructor Details
- (RubySexp) initialize(sexp)
270 271 272 273 274 275 276 |
# File 'lib/JRubyR/rbsexp.rb', line 270 def initialize(sexp) @sexp = sexp @rvar = nil @attr = Attributes.new(self) end |
Class Method Details
+ (Object) build(sexp)
298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 |
# File 'lib/JRubyR/rbsexp.rb', line 298 def self.build(sexp) if (sexp.instance_of? Java::OrgRenjinSexp::Null) res = nil elsif (sexp.instance_of? Java::OrgRenjinSexp::ListVector) res = Renjin::List.new(sexp) elsif (sexp.instance_of? Java::OrgRenjinSexp::LogicalArrayVector) res = Renjin::Logical.new(sexp) elsif (sexp.instance_of? Java::OrgRenjinSexp::Environment) res = Renjin::Environment.new(sexp) elsif (sexp.is_a? Java::OrgRenjinSexp::ComplexVector) res = Renjin::ComplexVector.new(sexp) elsif (sexp.is_a? Java::OrgRenjinSexp::Vector) res = Renjin::Vector.new(sexp) elsif (sexp.is_a? Java::OrgRenjinSexp::Closure) res = Renjin::Closure.new(sexp) # elsif (sexp.is_a? Java::OrgRenjinPrimitives::R$primitive$sum) # res = Renjin::Primitive.new(sexp) else p "sexp type needs to be specialized" p sexp res = Renjin::RubySexp.new(sexp) end return res end |
Instance Method Details
- (Object) fassign(function, value)
290 291 292 |
# File 'lib/JRubyR/rbsexp.rb', line 290 def fassign(function, value) R.fassign(self, function, value) end |
- (Object) to_string
282 283 284 |
# File 'lib/JRubyR/rbsexp.rb', line 282 def to_string R.eval("toString(#{r})") end |