[R-sig-Geo] rgeos::gArea() to all polygons within sp polygons DF

Edzer Pebesma edzer.pebesma at uni-muenster.de
Sun Apr 8 17:26:21 CEST 2012


Agus, have you tried

gArea(BorneoLCg, byid = TRUE)

?

On 04/08/2012 04:52 PM, Agustin Lobo wrote:
> Hi!
> 
> How do I  apply gArea()) to all polygons within an spatial pol. DF?
> I've tried
> areas <- apply(BorneoLCg,gArea)
> and
> areas <- sapply(BorneoLCg,gArea)
> 
> but this is not correct.
> 
> I want to compare to
> areas <- sapply(BorneoLCg at polygons, function(x) x at area)
> 
> Thanks
> 
> Agus
> 
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo

-- 
Edzer Pebesma
Institute for Geoinformatics (ifgi), University of Münster
Weseler Straße 253, 48151 Münster, Germany. Phone: +49 251
8333081, Fax: +49 251 8339763  http://ifgi.uni-muenster.de
http://www.52north.org/geostatistics      e.pebesma at wwu.de



More information about the R-sig-Geo mailing list