Class: Daru::IO::Importers::RDS
- Defined in:
- lib/daru/io/importers/rds.rb
Overview
RDS Importer Class, that extends read_rds
method to Daru::DataFrame
Direct Known Subclasses
Class Method Summary collapse
-
.read(path) ⇒ Daru::IO::Importers::RDS
Reads data from a rds file.
Instance Method Summary collapse
-
#call ⇒ Daru::DataFrame
Imports a
Daru::DataFrame
from a RDS Importer instance and rds file. -
#initialize ⇒ RDS
constructor
Checks for required gem dependencies of RDS Importer.
-
#read(path) ⇒ Daru::IO::Importers::RDS
Reads data from a rds file.
Methods inherited from Base
Constructor Details
#initialize ⇒ RDS
Checks for required gem dependencies of RDS Importer
13 14 15 |
# File 'lib/daru/io/importers/rds.rb', line 13 def initialize optional_gem 'rsruby' end |
Class Method Details
.read(path) ⇒ Daru::IO::Importers::RDS
Reads data from a rds file
28 29 30 31 |
# File 'lib/daru/io/importers/rds.rb', line 28 def read(path) @instance = RSRuby.instance.eval_R("readRDS('#{path}')") self end |
Instance Method Details
#call ⇒ Daru::DataFrame
Imports a Daru::DataFrame
from a RDS Importer instance and rds file
45 46 47 |
# File 'lib/daru/io/importers/rds.rb', line 45 def call process_dataframe(@instance) end |
#read(path) ⇒ Daru::IO::Importers::RDS
Reads data from a rds file
28 29 30 31 |
# File 'lib/daru/io/importers/rds.rb', line 28 def read(path) @instance = RSRuby.instance.eval_R("readRDS('#{path}')") self end |