rdatasets 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
data/data/upate.sh ADDED
@@ -0,0 +1,4 @@
1
+ #! /bin/bash
2
+ git clone https://github.com/vincentarelbundock/Rdatasets
3
+ rsync -arcv Rdatasets/csv/ ./
4
+ rm -rf Rdatasets
data/lib/rdatasets.rb CHANGED
@@ -20,11 +20,20 @@ module RDatasets
20
20
  # @return [String]
21
21
  def filepath(package_name, dataset_name)
22
22
  rdata_directory = File.expand_path('../data', __dir__)
23
- package_name = package_name.to_s if package_name.kind_of? Symbol
24
- dataset_name = dataset_name.to_s if dataset_name.kind_of? Symbol
23
+ package_name = package_name.to_s if package_name.is_a? Symbol
24
+ dataset_name = dataset_name.to_s if dataset_name.is_a? Symbol
25
+
26
+ # "car" package directory is a symbolic link.
27
+ # Do not use Symbolic links because they can cause error on Windows.
28
+ package_name = 'carData' if package_name == 'car'
25
29
  dataset_name << '.csv'
26
30
  File.join(rdata_directory, package_name, dataset_name)
27
31
  end
32
+
33
+ def packages
34
+ file_path = File.expand_path('../data/datasets.csv', __dir__)
35
+ Daru::DataFrame.from_csv(file_path)
36
+ end
28
37
  end
29
38
 
30
39
  module Daru
@@ -1,3 +1,3 @@
1
1
  module RDatasets
2
- VERSION = '0.3.1'.freeze
2
+ VERSION = '0.3.2'.freeze
3
3
  end
data/update.sh ADDED
@@ -0,0 +1,8 @@
1
+ wget https://github.com/vincentarelbundock/Rdatasets/archive/master.zip
2
+ unzip master.zip
3
+ rm master.zip
4
+ rsync -avr Rdatasets-master/csv/ data/
5
+ # symlink can cause a error in Windows
6
+ rm data/car
7
+ cp -f Rdatasets-master/datasets.csv data/datasets.csv
8
+ rm -rf Rdatasets-master
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rdatasets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - kojix2
@@ -771,7 +771,6 @@ files:
771
771
  - data/boot/tuna.csv
772
772
  - data/boot/urine.csv
773
773
  - data/boot/wool.csv
774
- - data/car
775
774
  - data/carData/AMSsurvey.csv
776
775
  - data/carData/Adler.csv
777
776
  - data/carData/Angell.csv
@@ -840,6 +839,7 @@ files:
840
839
  - data/cluster/ruspini.csv
841
840
  - data/cluster/votes.repub.csv
842
841
  - data/cluster/xclara.csv
842
+ - data/datasets.csv
843
843
  - data/datasets/AirPassengers.csv
844
844
  - data/datasets/BJsales.csv
845
845
  - data/datasets/BOD.csv
@@ -1292,6 +1292,7 @@ files:
1292
1292
  - data/texmex/summer.csv
1293
1293
  - data/texmex/wavesurge.csv
1294
1294
  - data/texmex/winter.csv
1295
+ - data/upate.sh
1295
1296
  - data/vcd/Arthritis.csv
1296
1297
  - data/vcd/Baseball.csv
1297
1298
  - data/vcd/BrokenMarriage.csv
@@ -1328,6 +1329,7 @@ files:
1328
1329
  - lib/rdatasets.rb
1329
1330
  - lib/rdatasets/version.rb
1330
1331
  - rdatasets.gemspec
1332
+ - update.sh
1331
1333
  homepage: https://github.com/kojix2/rdatasets
1332
1334
  licenses: []
1333
1335
  metadata:
@@ -1348,7 +1350,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1348
1350
  - !ruby/object:Gem::Version
1349
1351
  version: '0'
1350
1352
  requirements: []
1351
- rubygems_version: 3.0.1
1353
+ rubyforge_project:
1354
+ rubygems_version: 2.7.6
1352
1355
  signing_key:
1353
1356
  specification_version: 4
1354
1357
  summary: Ruby package for loading classical data sets vailable in R
data/data/car DELETED
@@ -1 +0,0 @@
1
- data/carData