[EMAIL PROTECTED] wrote: > Hi all, > > I've been struggling learning R and need to turn to the list again. > > I've got a dataset (comma-delimited file) with the following fields: > recid, latitude, longitude, population, dwelling and age. For each > observation, I'd like to calculate the total number of people and dwellings > and average age within 2 k.m. Distance could be Euclidean, however, a > proper distance calculation (great circle route) is best. > A good approximation is the haversine formula, see:
http://www.census.gov/cgi-bin/geo/gisfaq?Q5.1 for the spherical approximation and various corrections to account for the earth's departure from sphericity. Jim ______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html