[R] Frequencies from x/y data into a 2d table (for 3d histogram or heatmap)
ralf.bierig at gmail.com
Thu Mar 25 22:03:51 CET 2010
I have simple x/y data from screen recording in a sequence:
and would like to create a 3d histogram data structure that i can use
to create a 3d histogram or, more likely a heatmap. The unterlying
data structure therefore needs to look like this:
0-10 11-20 21-30 31-40
where the values in the cells represent counts of datapoints fitting
respective ranges for x and y. Can somebody point me to a procedure in
R that can make such a transformation for different range sizes (i.e.
10 in my example)? I came across the following method:
which seems (at least close) but did not get it running (could not
find clear3d()). I also dont' need the 3d histogram plot as I will be
using the table to create a heatmap. I might be thinking to
complicated here. To me, it seems like this should be possible with a
few lines of code. Perhaps one of you has them lying around somewhere
or knows a script that does the trick.
Thanks in advance!
More information about the R-help