> On 22 Dec 2016, at 18:08 , William Dunlap via R-help
> wrote:
>
> As a practical matter, 'continuous' data must be discretized, so if you
> have long vectors of it you will run into this problem.
Yep, and it is a bit unfortunate that hist() tries to use "pretty" breakpoints,
so that you wil
> William Dunlap
> on Thu, 22 Dec 2016 09:08:35 -0800 writes:
> As a practical matter, 'continuous' data must be discretized, so if you
> have long vectors of it you will run into this problem.
> Bill Dunlap
> TIBCO Software
> wdunlap tibco.com
Yes, it is true th
Willam has listed the lid on the essence of the problem, which is
that in R the way that breaks (and therefore counts) in a histogram
are evaluated is an area of long grass with lurking snakes!
To get a glimpse of this, have a look at
?hist
and in the seaction "Arguments", look at "breaks", "fre
As a practical matter, 'continuous' data must be discretized, so if you
have long vectors of it you will run into this problem.
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Thu, Dec 22, 2016 at 8:19 AM, Martin Maechler wrote:
> > itpro
> > on Thu, 22 Dec 2016 16:17:28 +0300 wri
Looking at the return value of hist will show you what is happening:
> x <- rep(1:6,10*(6:1))
> z <- hist(x, freq=TRUE)
> z
$breaks
[1] 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0
$counts
[1] 60 50 0 40 0 30 0 20 0 10
...
The the first bin is [1-1.5], including both endpoints, while the ot
> itpro
> on Thu, 22 Dec 2016 16:17:28 +0300 writes:
> Hi, everyone.
> I stumbled upon weird histogram behaviour.
> Consider this "dice emulator":
> Step 1: Generate uniform random array x of size N.
> Step 2: Multiply each item by six and round to next bigger in
Hi, everyone.
I stumbled upon weird histogram behaviour.
Consider this "dice emulator":
Step 1: Generate uniform random array x of size N.
Step 2: Multiply each item by six and round to next bigger integer to get
numbers 1 to 6.
Step 3: Plot histogram.
> x<-runif(N)
> y<-ceiling(x*6)
> hist(y,
7 matches
Mail list logo