Class: Rserve::REXP::Factor
- Inherits:
-
Integer
- Object
- Rserve::REXP
- Vector
- Integer
- Rserve::REXP::Factor
- Defined in:
- lib/rserve/rexp/factor.rb
Constant Summary
Constants inherited from Integer
Constants inherited from Rserve::REXP
Instance Attribute Summary collapse
-
#levels ⇒ Object
readonly
Returns the value of attribute levels.
Attributes inherited from Integer
Attributes inherited from Vector
Attributes inherited from Rserve::REXP
Instance Method Summary collapse
- #as_factor ⇒ Object
- #as_strings ⇒ Object
- #factor? ⇒ Boolean
-
#initialize(ids, levels, attr = nil) ⇒ Factor
constructor
A new instance of Factor.
- #to_ruby_internal ⇒ Object
- #to_s ⇒ Object
Methods inherited from Integer
#as_doubles, #as_integers, #integer?, #length, #na?, #numeric?, #to_debug_string
Methods inherited from Vector
#==, #length, #na?, #to_a, #vector?
Methods inherited from Rserve::REXP
#as_bytes, #as_double, #as_double_matrix, #as_doubles, #as_float, #as_floats, #as_integer, #as_integers, #as_list, #as_matrix, #as_nested_array, #as_string, #complex?, create_data_frame, #dim, #environment?, #expression?, #get_attribute, #has_attribute?, #inherits?, #integer?, #language?, #length, #list?, #logical?, #na?, #null?, #numeric?, #pair_list?, #raw?, #recursive?, #reference?, #split_array, #string?, #symbol?, #to_debug_string, #to_f, #to_i, #to_ruby, #vector?
Constructor Details
Instance Attribute Details
#levels ⇒ Object (readonly)
Returns the value of attribute levels.
4 5 6 |
# File 'lib/rserve/rexp/factor.rb', line 4 def levels @levels end |
Instance Method Details
#as_factor ⇒ Object
13 14 15 |
# File 'lib/rserve/rexp/factor.rb', line 13 def as_factor @factor end |
#as_strings ⇒ Object
16 17 18 |
# File 'lib/rserve/rexp/factor.rb', line 16 def as_strings @factor.as_strings end |
#factor? ⇒ Boolean
10 11 12 |
# File 'lib/rserve/rexp/factor.rb', line 10 def factor? true end |
#to_ruby_internal ⇒ Object
22 23 24 |
# File 'lib/rserve/rexp/factor.rb', line 22 def to_ruby_internal as_strings end |
#to_s ⇒ Object
19 20 21 |
# File 'lib/rserve/rexp/factor.rb', line 19 def to_s super+"[#{levels.length}]" end |