calculating area
At 12:14 AM -0700 1/26/07, Pedro S. A. Wolf wrote:
I am a psychology student who has been using R to analyze experimental data mainly within the general linear model for about 2 years. I have some working knowledge with R, but by no means would call myself proficient so bear with me. Currently I'm running a series of experiments dealing with spatial data. I'm tracking peoples movements using gps units which give me latitude, heading, longitude, speed, altitude, and time variables. I have been using the packages "maps" and "mapproj" to plot the routes which these individuals take which is a great visualization tool. I would like to know if there is a package or set of commands which would calculate the area these people occupy? So far the closest I have been able to get to accomplishing this task is basically taking the max and min for both lat and long coordinates and calculating the size of that area, but I would like something more accurate.
In addition to the good advice already sent by others:
A quick and simple improvement would be to get what's called the
convex hull. See
help.search('convex hull')
?chull
and some others.
The complex hull is a polygon, instead of the rectangle you're now
using, that will more closely surround your locations. Then all you
need is a function to calculate the area of a polygon. I know one or
more exists in R or a package, but I don't recall the name (or names).
Another thing I'm trying to accomplish is creating what I would call a density map. This is probably not the correct term so let me explain what I mean. I'm trying to characterize how people occupy space. Especially how people visit certain places more than others. Is there a way to create a map which shows the amount of times a particular place is visited by these people both within subjects and a second map between subjects? Help would be greatly appreciated, as my academic advisors know next to nothing about working with this type of data. Pedro [[alternative HTML version deleted]]
_______________________________________________ R-sig-Geo mailing list R-sig-Geo at stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo
-Don
-------------------------------------- Don MacQueen Environmental Protection Department Lawrence Livermore National Laboratory Livermore, CA, USA