p <- rbind(c(-180,-20), c(-140,55), c(10, 0), c(-140,-60), c(-180,-20))

# According to the algorithm of Michael Kearney (an authority on the
subject), the area is:
k <- 212053121833494.188  m^2

http://geographiclib.sourceforge.net/cgi-bin/Planimeter?type=polygon&input=-20+-180%0D%0A-60+-140%0D%0A0+10%0D%0A55+-140%0D%0A&option=Submit

# you say that matlab gives (+9 to +14 to use m^2):
m <- 2.524097207871018e+14

# geosphere
library(geosphere)
g <- areaPolygon(p)

# planar area:
pp <- makePoly(p, sp=T)
library(rgdal)
pc <- spTransform(pp, CRS("+proj=cea"))
library(rgeos)
a <- gArea(pc)

# makePoly added vertices. Do _not_ skip that like this
# pn <- SpatialPolygons( list(  Polygons(list(Polygon(p)), 1)),
proj4string=CRS("+proj=longlat +datum=WGS84"))
# pnc <- spTransform(pn, CRS("+proj=cea"))
# gArea(pnc)


> abs(g-k) / k
[1] 0.002493913
> abs(a-k) / k
[1] 0.0007897846
> abs(m-k) / k
[1] 0.1903136
>

I cannot comment on the validity of your approach in Matlab, but I think
that number is clearly not good.
I hope to be able to implement Kearney's code in geosphere sometime soon;
but it seems to give a reasonable number is most cases.
You mentioned splancs but I think it is safe to assume that that function
returns the area for planar polygons.

Robert

On Thu, Oct 25, 2012 at 12:19 PM, c.gutierrez <c74gutierrez@gmail.com>wrote:

> [correction]
> >>> The results are ~20% (~40*10^6 km^2) different.
>
>
>
> --
> View this message in context:
> http://r-sig-geo.2731867.n2.nabble.com/areaint-in-Matlab-vs-areaPolygon-or-areapl-in-R-tp7581399p7581413.html
> Sent from the R-sig-geo mailing list archive at Nabble.com.
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

	[[alternative HTML version deleted]]

