Module: Daru

Defined in:
lib/daru.rb,
lib/daru/io/io.rb,
lib/daru/vector.rb,
lib/daru/version.rb,
lib/daru/category.rb,
lib/daru/dataframe.rb,
lib/daru/core/merge.rb,
lib/daru/core/query.rb,
lib/daru/index/index.rb,
lib/daru/core/group_by.rb,
lib/daru/helpers/array.rb,
lib/daru/iruby/helpers.rb,
lib/daru/date_time/index.rb,
lib/daru/formatters/table.rb,
lib/daru/date_time/offsets.rb,
lib/daru/extensions/rserve.rb,
lib/daru/index/multi_index.rb,
lib/daru/io/sql_data_source.rb,
lib/daru/accessors/gsl_wrapper.rb,
lib/daru/plotting/gruff/vector.rb,
lib/daru/accessors/array_wrapper.rb,
lib/daru/index/categorical_index.rb,
lib/daru/maths/arithmetic/vector.rb,
lib/daru/maths/statistics/vector.rb,
lib/daru/plotting/gruff/category.rb,
lib/daru/plotting/nyaplot/vector.rb,
lib/daru/plotting/gruff/dataframe.rb,
lib/daru/accessors/mdarray_wrapper.rb,
lib/daru/accessors/nmatrix_wrapper.rb,
lib/daru/plotting/nyaplot/category.rb,
lib/daru/accessors/dataframe_by_row.rb,
lib/daru/maths/arithmetic/dataframe.rb,
lib/daru/maths/statistics/dataframe.rb,
lib/daru/plotting/nyaplot/dataframe.rb

Overview

Support for converting data to R data structures to support rserve-client

Defined Under Namespace

Modules: Accessors, ArrayHelper, Category, Core, DateTimeIndexHelper, Formatters, IO, IOHelpers, IRuby, Maths, Offsets, Plotting Classes: CategoricalIndex, DataFrame, DateOffset, DateTimeIndex, Index, MultiIndex, NegativeDateOffset, Vector

Constant Summary collapse

DAYS_OF_WEEK =
{
  'SUN' => 0,
  'MON' => 1,
  'TUE' => 2,
  'WED' => 3,
  'THU' => 4,
  'FRI' => 5,
  'SAT' => 6
}.freeze
MONTH_DAYS =
{
  1 => 31,
  2 => 28,
  3 => 31,
  4 => 30,
  5 => 31,
  6 => 30,
  7 => 31,
  8 => 31,
  9 => 30,
  10 => 31,
  11 => 30,
  12 => 31
}.freeze
MISSING_VALUES =
[nil, Float::NAN].freeze
SPLIT_TOKEN =
','.freeze
VERSION =
'0.1.5'.freeze

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.lazy_updateObject

A variable which will set whether Vector metadata is updated immediately or lazily. Call the #update method every time a values are set or removed in order to update metadata like positions of missing values.



45
46
47
# File 'lib/daru.rb', line 45

def lazy_update
  @lazy_update
end

.plotting_libraryObject

Returns the value of attribute plotting_library.



46
47
48
# File 'lib/daru.rb', line 46

def plotting_library
  @plotting_library
end

Class Method Details

.create_has_library(library) ⇒ Object



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/daru.rb', line 48

def create_has_library(library)
  lib_underscore = library.to_s.tr('-', '_')
  define_singleton_method("has_#{lib_underscore}?") do
    cv = "@@#{lib_underscore}"
    unless class_variable_defined? cv
      begin
        library = 'nmatrix/nmatrix' if library == :nmatrix
        require library.to_s
        class_variable_set(cv, true)
      rescue LoadError
        # :nocov:
        class_variable_set(cv, false)
        # :nocov:
      end
    end
    class_variable_get(cv)
  end
end