r - Calculating area of occupancy from a binary unprojected raster -


I have a series of binary wrapper layers (ASCI files) showing the presence / absence of species in Europe and Africa. The file is based on unrestricted latitude / long (WGS84) data. My objective is to calculate the field of attendance using R (I do not have access to ARGGIS).

I know that there is a function for calculating the area in the raster package, but I worry that this will not be accurate for unrestricted data. I have also seen the cellstats function in the Rekhapur package, and can use it to "yoga" the number of "cell", but I think it has only one problem.

  jan & lt; -raster ("/filelocation/file.asc") John Class: Rosterlear Dimensions: 13800, 9600, 132480000 (Enroo, NXL, ENCEL) Resolution: 0.008333333, 0.008333333 (X, Y) range: -20, 60, -40, 75 (Xmin, xmax, ymin, ymax) coordinate ref : NA Data source: "/ file location" Name: file.asc value: -2147483648, 2147483647 (minimum, maximum) area (mass) Category: Rastlinline Dimensions: 13800, 9600, 132480000 (Enroo, Nucleus, Encel) Resolution: 0.008333333 , 0.008333333 (X, Y) Height: -20, 60, -40, 75 (Xmin, XMX, Yemen, WiMAX) Coordination Ref. : NA Name: Layer value: 6.944444e-05, 6.944444e-05, warning message: 1: .local (x, ...): This function is only for a raster * objects in a longitude / latitude coordinate 2:. RasterFromRasterFile (grdfile, band = band, objecttype, ...): The size of the values ​​does not match the number of cells (data type given) cellstats (mass, "yoga") [1] 3559779   

Div class = "post-text" "Itemprop =" text ">

I do not know what is going on in your file (why you give warning # 2). But here's a job

  r < Raster (nero = 13800, niacal = 9600, xmn = -20, xmx = 60, ymn = -40, ymx = 75) # raster (jane) x = area (r) x squared: rasterline dimensions: 13800, 9600, 132480000 (Enroo, NXL, ENCEL) Resolution: 0.008333333, 0.008333333 (X, Y) range: -20, 60, -40, 75 (Xmin, XMX, Yemen, WiMAX) Coordination Ref. : + Proj = longlat + datum = WGS84 Data source: c: \ temp \ R_raster_Robert \ 2015-01-26_213612_1208_85354.grd Name: Layer value: 0.2227891, 0.8605576 (minimum, maximum)  

Now you have area of ​​each cell in km2, by multiplying these values ​​with raster objects with presence / absence and then using cellstats (, 'yoga') you can get total area with presence.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -