From: Paul Danese Date: 2008-04-01T21:33:05+09:00 Subject: Re: numbers of a record in an array Frequency exists in 2.4.0, but there appear to be some path problems w/ 2.4.0. Try uninstalling 2.4.0 and installing 2.3.0 instead. -----Original Message----- From: jzakiya [mailto:jzakiya@mail.com] Sent: Friday, March 28, 2008 11:40 AM To: ruby-talk ML Subject: Re: numbers of a record in an array On Mar 27, 10:51 am, Paul Danese 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? This email and any attached files are confidential and intended solely for the intended recipient(s). If you are not the named recipient you should not read, distribute, copy or alter this email. Any views or opinions expressed in this email are those of the author and do not represent those of the company. Warning: Although precautions have been taken to make sure no viruses are present in this email, the company cannot accept responsibility for any loss or damage that arise from the use of this email or attachments.