Skip to content

Problem with histogram

4 messages · Vladimir Morozov, Brian Ripley, PIKAL Petr +1 more

#
Hi Everyone
I have 1dim array of data, which spans, say from 0 to 60. I would like 
to histogram that data only in the range of 0 to 10. How do I do that?
Something like
truehist(data,breaks=c(0:10)) returns an error message " breaks do not 
cover tha data"

Please help.

Thank you,
Vlad.


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
On Tue, 18 Jun 2002 VBMorozov at lbl.gov wrote:

            
truehist(data[data <= 10])
#
On 18 Jun 2002 at 9:25, VBMorozov at lbl.gov wrote:

            
Not completely sure what do you intend but what about

truehist(yourdata[yourdata<10])

or in case you want rescaling something like

truehist(yourdata*10/max(yourdata))

may help
Petr Pikal
petr.pikal at precheza.cz
p.pik at volny.cz


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
OK <- mydata <= 10
truehist(mydata[OK])

Kjetil Halvorsen
VBMorozov at lbl.gov wrote:
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._