[R-sig-Geo] R: individuals distribution points in paired polygons
Alice C. Hughes
dr_achughes at hotmail.co.uk
Sun Sep 7 13:16:21 CEST 2014
Thanks. The distribution data for each individual is in an excel sheet with the individuals ID, and the lat and long it was recorded. There is one to several hundred distribution locality (point) records for each individual. I also have a polygon (from another source) for each of those individuals-and I want to know how many of the distribution points for each individual fall into the appropriate polygons.
Though the distribution data is in excel-each record refers to a point, and I have a point (i.e. GIS version of each-both for all the individuals together, and is folder with each separated: which could also be used).What I would envisage is a script that reads through the polygon names, to get the list of individuals, and then goes through the list finding how many of the records of each one fall within that individuals polygon
Thanks so much
Alice C. HughesAssociate ProfessorCentre for Integrative Conservation,Xishuangbanna Tropical Botanical Garden,Chinese Academy of SciencesMenglun, Mengla, Yunnan 666303, P.R. ChinaPh: 15198676559achughes at xtbg.ac.cn
> Date: Sun, 7 Sep 2014 10:57:58 +0100
> Subject: Re: [R-sig-Geo] R: individuals distribution points in paired polygons
> From: b.rowlingson at lancaster.ac.uk
> To: dr_achughes at hotmail.co.uk
> CC: rubenfcasal at gmail.com; mfiori at arpa.sardegna.it; r-sig-geo at r-project.org
> On Sun, Sep 7, 2014 at 9:31 AM, Alice C. Hughes
> <dr_achughes at hotmail.co.uk> wrote:
> > I have distribution points (in excel or spatial point form) for a set ofindividuals and a file of polygons-with matching IDs: so each individual hasa set of points and a polygon with the same IDs:
> Sounds like you have a dataset of Person_ID, Polygon_ID pairs - two columns...
> >but there are 100's to1000's of individuals.
> and 100 or a 1000 rows for each individual times however many
> observations for each individual. Not exactly Big Data...
> > What I would like to do is to go through and for each individual find thetotal number of points and the number which fall within the appropriatepolygon
> Assuming your data are in a dataframe called "distribution", then
> that's trivially:
> table(distribution$Person_ID, distribution$PolygonID)
> > then have the output in spreadsheet form with a column for ID;Total number of points; points in polygon. Each individual has a polygon with the same name, but every code I've seenso far can't differentiate, or scroll through multiple point files withunique IDs
> Now here's where we get lost. Multiple "point files" wth unique IDs?
> What are "point files"? Where did they come from? You need to clearly
> state the structure of your data, what you've read into R, and give
> some summaries of it.
[[alternative HTML version deleted]]
More information about the R-sig-Geo