rdatasets 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f389577db8c4aede4d03551b0a6788a0f1970c8b5d79da1f70e77876f9a74d28
4
- data.tar.gz: b1801bf49f1a39cc3eb8b06e045d7a4a2643fcba624623c8901b18aa1535de40
3
+ metadata.gz: a46abed3f289f2dfebb6f28071d802c05d8b2a4a227749a60680db49ae4723a8
4
+ data.tar.gz: 1926223ce67700e6f4bc2dceb0439092cc0e0e18c78040e0f6f77c599fd28e04
5
5
  SHA512:
6
- metadata.gz: b75eb647f720b21312f4d55d215d988678641d967f64b27362fcb086d1ea59d7780b3a041fc5417c71eb5dce548c2360afa5fd52197a4314a45102dc6f3b860b
7
- data.tar.gz: aa748bdc70807c89a18b8cc64a9d317225382e9180295689200f564747ce7ef8b04ff7c99fef801813d3d258dad1500ede97d0b1bd804c7fce621366801e3501
6
+ metadata.gz: 44e3e59bb2feb08c8baf583e4955c8da76292187d3d8e07feae9094fc4cf358d8824a8cce86143614ffdae122d57c6a41e57798b07faf9c12c327eb97ce65e67
7
+ data.tar.gz: 4c81ba19319dcb0ab6c59f6797e460d3ed02cfe7b7f65019bcc2ce74890bff14b5eddd8c3213b63e152ee82794f9612b904ac162e0cbcd94ebe45e2fc1d86f35
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rdatasets (0.4.1)
4
+ rdatasets (0.4.2)
5
5
  daru
6
6
 
7
7
  GEM
@@ -15,7 +15,7 @@ GEM
15
15
  packable (1.3.10)
16
16
  backports
17
17
  parallel (1.13.0)
18
- parallel_tests (2.27.1)
18
+ parallel_tests (2.28.0)
19
19
  parallel
20
20
  rake (10.5.0)
21
21
  rspec (3.8.0)
data/README.md CHANGED
@@ -27,7 +27,7 @@ bundle exec rake install
27
27
 
28
28
  ```ruby
29
29
  require 'rdatasets'
30
- df = Daru::DataFrame.from_rdatasets("datasetss","iris")
30
+ df = Daru::DataFrame.from_rdatasets("datasets","iris")
31
31
  df = RDatasets.load("datasets", "iris")
32
32
  # returns Daru::DataFrame
33
33
  ```
data/lib/rdatasets.rb CHANGED
@@ -65,9 +65,21 @@ module RDatasets
65
65
  end
66
66
  end
67
67
 
68
+ # Search available datasets. (items and titles)
69
+ # If the argument is a string, ignore case.
70
+ # @param pattern [String, Regexp] :The pattern to search for
71
+ # @return [Daru::DataFrame]
72
+ def search(pattern)
73
+ pattern = /#{pattern}/i if pattern.is_a? String
74
+ p pattern
75
+ datasets.filter(:row) do |row|
76
+ row['Item'] =~ pattern || row['Title'] =~ pattern
77
+ end
78
+ end
79
+
68
80
  # Check if the index of original r dataset is sequential.
69
- def original_index_is_sequential?(df)
70
- df[0].to_a == [*1..df.size]
81
+ def original_index_is_sequential?(dataframe)
82
+ dataframe[0].to_a == [*1..dataframe.size]
71
83
  end
72
84
  private_class_method :original_index_is_sequential?
73
85
  end
@@ -1,3 +1,3 @@
1
1
  module RDatasets
2
- VERSION = '0.4.1'.freeze
2
+ VERSION = '0.4.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rdatasets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - kojix2
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-22 00:00:00.000000000 Z
11
+ date: 2019-02-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: daru