Hello,

I found a code to produce a histogram at

http://code.jsoftware.com/wiki/Essays/Histogram.

However, both the description and the function seem odd.
The code reads

histogram=: <: @ (#/.~) @ (i.@#@[ , I.)

1)
They say: ---The left argument is a list of interval *start* points.---,
which I think is not quite right (or is at least deceptive):

        2 3 histogram 1
1 0

        2 3 histogram 2

1 0

(thus x are actually inclusive endpoints).

2)
Furthemore and more importantly:
        2 histogram 1
1
        2 histogram 10
0 0

which (the 2nd case) is not nice, since the shape of the result
changes depending on data *value*.

I'd rather have a verb that would output
        2 hist 1
1 0
        2 hist 10
0 1

Does anyone have a verb like that? (I will try to design one myself, but
am asking anyway.)

Thanks
Ruda
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to