Permalink
Browse files

Add size method

  • Loading branch information...
1 parent 24ab3fa commit 97b80e9eb17df69a2c37a99eaed2a564b3733d5f @pjotrp committed Feb 27, 2014
Showing with 5 additions and 1 deletion.
  1. +1 −1 README.md
  2. +4 −0 lib/bio-table/filter.rb
View
@@ -136,7 +136,7 @@ which takes the first 13 fields and compact removes the nil values.
To filter out all rows with more than 3 NA values:
```sh
- bio-table table.csv --num-filter 'values.to_a.size - values.compact.size > 3'
+ bio-table table.csv --num-filter 'values.size - values.compact.size > 3'
```
Also string comparisons and regular expressions can be used. E.g.
View
@@ -37,6 +37,10 @@ def compact
end
a
end
+
+ def size
+ @fields.size
+ end
end
module Filter

0 comments on commit 97b80e9

Please sign in to comment.