s-news
[Top] [All Lists]

Re: use hist to plot frequency distribution

To: "'yiwu ye'" <yiwu21111958@yahoo.com>
Subject: Re: use hist to plot frequency distribution
From: "Thomas Jagger" <tjagger@blarg.net>
Date: Tue, 18 Oct 2005 00:38:17 -0600
Cc: <s-news@lists.biostat.wustl.edu>
In-reply-to: <20051018051939.28028.qmail@web34410.mail.mud.yahoo.com>
Thread-index: AcXTo5oxvIfx8hrYQpOW0cgLtjYLhwACNOrw
Hello,
Yiwu, 

You need to span the range of your data. 
That is if 
rx<-range(x) ## and your set of breaks is mybreaks then you get the error if

rx[1] < min(mybreaks)  || rx[2] > max(mybreaks)

returns T. So you might use 

if(rx[1] < min(mybreaks)) mybreaks<-c(rx[1],mybreaks)
if(rx[2] > max(mybreaks)) mybreaks<-c(mybreaks,rx[2])

hist(x,breaks=mybreaks) #should work, but you might want better breaks

Tom


Dr. Thomas Jagger
Florida State University
Department of Geography

 
 
-----Original Message-----
From: s-news-owner@lists.biostat.wustl.edu
[mailto:s-news-owner@lists.biostat.wustl.edu] On Behalf Of yiwu ye
Sent: Monday, October 17, 2005 11:20 PM
To: s-news@lists.biostat.wustl.edu
Subject: [S] use hist to plot frequency distribution

Dear list,

When I use hist to plot frequency distribution with
breaks like hist(x,breaks=breaks), an error message
says "Problem in hist(x, breaks = breaks): breaks do
not span the range of x. Use traceback() to see the
call stack". Does anyone know how to solve this
problem? Thanks for your help.
Yiwu





                
__________________________________ 
Yahoo! Music Unlimited 
Access over 1 million songs. Try it free.
http://music.yahoo.com/unlimited/
--------------------------------------------------------------------
This message was distributed by s-news@lists.biostat.wustl.edu.  To
unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
the BODY of the message:  unsubscribe s-news


<Prev in Thread] Current Thread [Next in Thread>