Thanks a lot Roger!

But dont you think that using this approach I would have error due to
differences in latitudinal position among cells?
As I want to compare diistributional ranges among categories of species,
would like to avoid any bias related to their latitudinal range.

Do you know if is there any way to generate a spatialpolygon dataframe for
the boundary of the maxent model?
I thought I might use areaPolygon then.

Cheers and thanks again!
Agus

2011/12/21 Robert J. Hijmans <r.hijmans@gmail.com>

> Agus,
>
> I think you were on the right track with 'area'. I would suggest:
>
> library(dismo)
> ?maxent
> ...
> r <- predict(me, predictors, progress='window')
>
> # and now:
>
> a <- area(r)
> threshold <- 0.5
>
> x <- a * (r > threshold)
>
> cellStats(x, 'sum')
>
> Best, Robert
>
> On Tue, Dec 20, 2011 at 10:35 PM, agus <agus.camacho@gmail.com> wrote:
>
>> Hello all,
>>
>> I am trying to calculate the exact area in km2 for a given maxent model of
>> distribution of a species, at a given probability of occurrence.
>>
>> How could be the best way to do that?
>>
>> I tried     area (model) but it seems to give me the number of pixels of
>> the
>> square generated by the maximum values of long/lat.
>>
>> I also tried to use:
>> pred_area=length(a@data@values[a@data@values>quantile(a@data
>> @values,c(0.95))])
>>
>> To find the number of raster cells that have a given probability of
>> finding
>> the species, and then multiplying it by the resolution. However, I think
>> this does not correct for the spatial diferences between raster cell sizes
>> along latitudinal gradients.
>>
>> Finally, given a set of coordinates x, I think I might use:
>>
>> coords=x
>> coordinates(coords) <- ~Longitude+Latitude
>> projection(coords) <- " +proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0
>> +no_defs"
>> r = raster(coords)# avoiding South Pole; bugs there.
>> p = rasterToPolygons(r)# or a sp coerce method from the spgdf
>> dist.extent=(areaPolygon(p)/10^6)# area in km2
>>
>> to calculate the extent of distribution.
>>
>> However, help tells that polygons should not self intersect for
>> areaPolygon() to work well. Then, how to avoid intersecting polygons from
>> a
>> maxent model or just a set of occurences?
>>
>> In other words:
>> How to extract coordinates of the boundaries of a distributional model,
>> at a
>> given probability of occurrence, and then calculate the area?
>>
>> Any hint/paper/package documentation you could recommend would be welcome.
>>
>>
>> Thanks a lot!
>> Agus
>>
>>
>> --
>> View this message in context:
>> http://r-sig-geo.2731867.n2.nabble.com/xtracting-coordinates-of-model-boundaries-tp7114268p7114268.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
>>
>
>


-- 
Agustín Camacho Guerrero.
Doutorando em Zoologia.
Laboratório de Herpetologia, Departamento de Zoologia, Instituto de
Biociências, USP.
Rua do Matão, trav. 14, nº 321, Cidade Universitária,
São Paulo - SP, CEP: 05508-090, Brasil.

	[[alternative HTML version deleted]]

