Module: Daru

Defined in:
lib/daru/extensions/rserve.rb,
lib/daru.rb,
lib/daru/index.rb,
lib/daru/io/io.rb,
lib/daru/vector.rb,
lib/daru/version.rb,
lib/daru/dataframe.rb,
lib/daru/core/merge.rb,
lib/daru/core/query.rb,
lib/daru/core/group_by.rb,
lib/daru/date_time/index.rb,
lib/daru/plotting/vector.rb,
lib/daru/date_time/offsets.rb,
lib/daru/io/sql_data_source.rb,
lib/daru/plotting/dataframe.rb,
lib/daru/accessors/gsl_wrapper.rb,
lib/daru/accessors/array_wrapper.rb,
lib/daru/maths/arithmetic/vector.rb,
lib/daru/maths/statistics/vector.rb,
lib/daru/accessors/mdarray_wrapper.rb,
lib/daru/accessors/nmatrix_wrapper.rb,
lib/daru/accessors/dataframe_by_row.rb,
lib/daru/maths/arithmetic/dataframe.rb,
lib/daru/maths/statistics/dataframe.rb

Overview

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

Defined Under Namespace

Modules: Accessors, Core, DateTimeIndexHelper, IO, IOHelpers, Maths, Offsets, Plotting Classes: DataFrame, DateOffset, DateTimeIndex, Index, MultiIndex, 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
SPLIT_TOKEN =
','.freeze
VERSION =
'0.1.3.1'.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.



39
40
41
# File 'lib/daru.rb', line 39

def lazy_update
  @lazy_update
end

Class Method Details

.create_has_library(library) ⇒ Object



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/daru.rb', line 41

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
        class_variable_set(cv, false)
      end
    end
    class_variable_get(cv)
  end
end