[R] averaging 3D datasets

Dewez Thomas t.dewez at brgm.fr
Mon Aug 2 18:28:28 CEST 2004

Dear R-users,

I've spent most of the day reading R documentation at length but couldn't
find something perhaps obvious.

I have a dataset made of 3 morphometric variables for a series of watershed
[log(slope); log(drainage_area); distance_to_outlet]

My aim is to predict the value of log(slope) for pairs of [drainage_area;
distance_to_outlet] (sounds like a plain linear model fitting, right,
nothing too fancy there). In the literature, the standard procedure is to
reduce the number of observations by computing the mean value of slope
insides bins of log(drainage_area) and distance_to_outlet respectively.
Usually, we start with dispersed point clouds and try desperately to reduce
the scatter, hence this binning and averaging procedure. 
How would you go about this?

That is:
1. how does one create bins in two (or n?) dimensions?
2. how does one how does one compute the mean(or median) value of log(slope)
inside each bin?

Any clue is welcome

Le contenu de cet e-mail et de ses pièces jointes est destiné à l'usage exclusif du 
(des) destinataire(s) expressément désigné(s) comme tel(s). En cas de réception de cet 
 e-mail par erreur, le signaler à son expéditeur et ne pas en divulguer le contenu. 
L'absence de virus a été vérifié à  l'émission du message. Il convient néanmoins de 
vérifier l'absence de corruption à sa réception.

The contents of this email and any attachments are confidential. They are intended for 
the named recipient(s) only. If you have received this email in error please notify the 
system manager or  the sender immediately and do not disclose the contents to 
anyone or make copies. eSafe scanned this email for viruses, vandals and malicious 

More information about the R-help mailing list