[R-sig-Geo] R Help

Mistry, Krishan km314 at student.le.ac.uk
Thu Jan 7 21:24:36 CET 2016


Dear Sir/Madame,

I am currently a Masters student at the University of Leicester in the UK studying MSc Geographical Information Science and am having a bit of difficulty with the programme R. I am a new user of the programme and don't have any previous experience in programming. Having looked at various web sites, I wondered if you are able to help me with some trouble i am having in trying to write some code for a mathematical equation.
I have attached the question to this email and it can be seen below. The dataset is a list of polygons with each polygon containing another list within it, of x and y coordinates.

I would really appreciate it, if you could help me with this question.

Question
Create functions to compute the area, centroid and perimeter of a polygon list (as in the format of georgia.polys). The formula for the area of a polygon is

A=0.5*?(x? y???) (x??? y?)      for i until n-1

where A is the polygon area, xi is the ith x-coordinate of the polygon boundary (x[i] in R), yi is the ith ycoordinate of the polygon boundary (y[i] in R) - and n is the number of points used to specify the polygon boundary. The polygon is assumed to be in closed form so that the x1 and y1 take the same value as xn and yn.

Hope to hear from you soon.

Yours sincerely

Krishan Mistry



	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list