Many thanks to Thomas. His suggestion solved my
problem . Thanks, Again. Yiwu
--- Thomas Jagger <tjagger@blarg.net> wrote:
> 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
>
>
--------------------------------------------------------------------
> 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
>
__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com
|