Class: Rover::Group
- Inherits:
-
Object
- Object
- Rover::Group
- Defined in:
- lib/rover/group.rb
Instance Method Summary collapse
- #group(*columns) ⇒ Object
-
#initialize(df, columns) ⇒ Group
constructor
A new instance of Group.
- #plot(*args, **options) ⇒ Object
Constructor Details
#initialize(df, columns) ⇒ Group
Returns a new instance of Group.
3 4 5 6 7 |
# File 'lib/rover/group.rb', line 3 def initialize(df, columns) @df = df @columns = columns check_columns end |
Instance Method Details
#group(*columns) ⇒ Object
9 10 11 |
# File 'lib/rover/group.rb', line 9 def group(*columns) Group.new(@df, @columns + columns.flatten) end |
#plot(*args, **options) ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/rover/group.rb', line 26 def plot(*args, **) raise ArgumentError, "Multiple groups not supported" if @columns.size > 1 # same message as Ruby raise ArgumentError, "unknown keyword: :group" if .key?(:group) @df.plot(*args, **, group: @columns.first) end |