MathGroup Archive 1998

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: FW: Re: Frequencies function

  • To: mathgroup at
  • Subject: [mg15214] Re: [mg15180] FW: Re: Frequencies function
  • From: Des Penny <penny at>
  • Date: Tue, 22 Dec 1998 04:01:44 -0500
  • Organization: Southern Utah University
  • References: <>
  • Sender: owner-wri-mathgroup at

Dear Debbie:
I tried the following and had no trouble:

 Needs["Statistics`DataManipulation`"] In[3]:=
"Frequencies[list] gives a list of the distinct elements in list,
together \ with the frequencies with which they occur." In[4]:=
lis ={1,3,2,5,2,4,1};

If when you executed Frequencies[lis], you got lis back, then
Frequencies must be executing - however it may not be the function that
is contained in the Statistics Package.  Perhaps you have a shadowing
problem here.  If you defined your own function "Frequencies", before
you read in the Statistics package, then your function will be defined
in the Global context and will thus shadow the Frequencies function
just read in.  It may be that your function (Global`Frequencies) is
executing and not the Statistics function

The following commands will help you understand what is happening:
(This will tell you which packages are loaded.) $ContextPath
(This tells you how Mathematica looks for variables.  Mathematica
searches the current context first  and then searches each context in
$ContextPath.) $Context
(Gives the current context)


to give you the information you need with your particular function.

Finally, avoid using << to read in a package.  Use
         Needs["Statistics`DataManipulation`"] instead.  Needs only
reads in a package when it has not been read in before. Some packages
cannot be read-in a second time.

Hope this helps.


Des Penny
Physical Science Dept
Southern Utah University
Cedar City, Utah 84720

Voice: (435) 586-7708
FAX: (435) 865-8051
Email: penny at

jim leddon wrote:

> -----Original Message-----
> From:   jim leddon [SMTP:jleddon at] Sent:   Thursday, December
To: mathgroup at
> 17, 1998 6:46 AM To:    'mathgroup at'
> Subject: [mg15214]        Re: Frequencies function
> Hello,
> I am trying to use the 'Frequencies" function under the data
> manipulation package as described below:
> in[1]: ClearAll;
> in[2]: <<Statistics`DataManipulation`
> in[3]: lis ={1,3,2,5,2,4,1};
> in[4]: freq = Frequencies[lis]
> out[4]: {1,3,2,5,2,4,1}
> in essence, I just get a repeat of the data list, "lis". What could be
> wrong?
> Thanks in advance for your help.
> Regards,
> Debbie Leddon

  • Prev by Date: Re: Compile and NormalDistribution
  • Next by Date: Re: Question about how Contex resolving works in Mathematica
  • Previous by thread: Re: FW: Re: Frequencies function
  • Next by thread: Re:FW: Re: Frequencies function