Skip to content

Need frequency distribution for x,y coordinates

5 messages · mark shanks, Gabor Grothendieck, Roger Bivand +2 more

#
Hi,

I have a set of data in x,y coordinates across the range of -5 to 5 in each 
dimension. I would like to obtain the frequency distribution of the 
different points, and then graph them so you can see which of the points are 
the most frequently occurring.

This would seem to be easy in Matlab, which has the hist3 command for doing 
frequency distributions/histograms in 3 dimensions. However, as far as I can 
tell, R does not have a hist3 command.

Is there any easy way to do this in R? I'm investigating whether matlab or R 
is more suitable for our needs, but don't want to reject R due to my present 
ignorance of its functions.

_________________________________________________________________
realestate.com.au: the biggest address in property   
http://ninemsn.realestate.com.au
#
Check out:

http://addictedtor.free.fr/graphiques/graphcode.php?graph=116
On 2/11/06, mark shanks <markshanks101 at hotmail.com> wrote:
#
On Sat, 11 Feb 2006, mark shanks wrote:

            
See contributed package ash, function bin2:
or
Using the x and y arguments to image or filled.contour, you can set the 
axes, and asp=1 to preserve aspect.

See also function kde2d in package MASS - included in the standard 
distribution.

IMO, 3D histograms can mislead because perception depends on viewer 
position. All of the above give readily interpreted visualisations based 
on colour class intervals.

  
    
#
On Sat, 11 Feb 2006, Roger Bivand wrote:

            
And density plots are usually a lot better than histograms for 
understanding 2D data.
But if you really want one, see demo("hist3d") in package rgl, which 
allows you to change your position interactively and uses translucency.