Re: [R-sig-Geo] Extract() fails to return data for boundary admin units

2016-10-18 Thread ping yang
I also found issues with the raster::extract function, for some reason, I got crazy values when I compared the resulting value with the one from QGIS(Zonal Statistics Plugin) and ArcGIS(zonal statistics), while the value from qgis and arcgis were close but the raster::extract has a lot of

Re: [R-sig-Geo] Extract() fails to return data for boundary admin units

2016-10-18 Thread Bacou, Melanie
Chris, Actually I take that back, using extract() with `weights=TRUE` returned `0` instead of NA values for these problematic coastal admin units. Think I might have to impute them manually. --Mel. On 10/18/2016 2:33 PM, Bacou, Melanie wrote: > > Chris, > Thanks, using `weights=TRUE` to

Re: [R-sig-Geo] Extract() fails to return data for boundary admin units

2016-10-18 Thread Bacou, Melanie
Chris, Thanks, using `weights=TRUE` to compute the means fixed the problem. Perfect, --Mel. On 10/18/2016 11:10 AM, chris english wrote: > > Mel, > > Looking at detail in cjg.png the northmost missing data island shows > approx 20-25 in Southern three quarters and 0-5 the small North at tip >

Re: [R-sig-Geo] Extract() fails to return data for boundary admin units

2016-10-18 Thread chris english
Mel, Sorry, your pseudo-code: raster::extract(udel, admin, fun=mean, na.rm=T, small=T, weights = TRUE) Chris On Tue, Oct 18, 2016 at 6:10 PM, chris english < englishchristoph...@gmail.com> wrote: > Mel, > > Looking at detail in cjg.png the northmost missing data island shows > approx 20-25 in

Re: [R-sig-Geo] Extract() fails to return data for boundary admin units

2016-10-18 Thread chris english
Mel, Looking at detail in cjg.png the northmost missing data island shows approx 20-25 in Southern three quarters and 0-5 the small North at tip of island. Directly above this 0-5 another coastal 0-5. If a substantial east-west scarp bisected the island it might explain. I would otherwise expect

[R-sig-Geo] Extract() fails to return data for boundary admin units

2016-10-18 Thread Bacou, Melanie
Hi, I'm summarizing biophysical rasters (UDEL precipitation and temperature) across administrative units for countries in Africa using (pseudo code): raster::extract(udel, admin, fun=mean, na.rm=T, small=T) Out of the 756 units I need data for, extract() fails to return means for a few