I have a lot of longitude and latitude information for several polygons. I want to calculate the area for every polygon. How to perform it in R software? Is there any packages to this kind of calculation? Thanks.
Please see Bivand, R. and Gebhardt, A. 2000 Implementing functions for spatial statistical analysis using the R language. Journal of Geographical Systems, 2, 307-317. And see http://cran.r-project.org/web/views/Spatial.html, which is dedicated R page for spatial analysis in R.
The gArea() function in the rgeos library does this (see http://127.0.0.1:18944/library/rgeos/html/gArea.html). Getting your polygon into R can be tricky, however.
define a polygon instance from the superclass 'sp' - the easiest way to do this is by designing a char string that the function readWKT (from rgeos) can use to create the instance, typically something like "POLYGON((
It is definitely possible in qgis..by adding geometry columns to the existing shape file..Once the area and perimeter attributes are added, you could save it into the existing shape file and export it into R and use the area of the underlying polygons
This is my (straightforward) solution to calculating the area of hysteresis loops from cyclic testing using the R package. My Stress and Strain data (for an individual loop) were in a dataframe called 'DF'.
The sf (simple features) package is also good for this (in conjuction with the lwgeom package). You can use the function st_area(x) to calculate the area. x