On Mar 28, 11:39 am, jzakiya <jzak... / mail.com> wrote:
> On Mar 27, 10:51 am, Paul Danese <pdan... / Rib-x.com> wrote:
>
>
>
> > If you install the facets gem you can use "frequency"
>
> > e.g.
>
> > >irb
>
> > irb:> require 'rubygems'
> > => false
> > irb:> require 'facets'
> > => true
> > irb:> x = %w[a b d e e rkeke ele e ee e e el d]
> > => ["a", "b", "d", "e", "e", "rkeke", "ele", "e", "ee", "e", "e", "el",
> > "d"]
> > irb:> x.frequency
> > => {"ee"=>1, "a"=>1, "b"=>1, "d"=>2, "e"=>5, "el"=>1, "ele"=>1,
> > "rkeke"=>1}
>
> I installed facets 2.4.0 (the current latest) and tried to use the
> 'frequency' method shown in this example, but in doesn't exist in this
> version of facets.
>
> I did 'ri facets' and it only returned 'Enumerable#frequency'
> This is using Linux (PCLOS) and Ruby 1.8.6-p114.
>
> What version of facets does the 'frequency' method exist in, because
> it isn't in version 2.4.0?

Correction:
I did 'ri frequency' NOT 'ri facets'