[R-sig-Geo] Calculating 95th percentile within polygons

2011-10-18 Thread Zia Ahmed
I am trying to calculating 95th percentile within polygons from a of set realizations - something like zonal statistics. How do I calculate 95 th percentile for each polygon over all realizations. Thanks Zia For example: data(meuse) data(meuse.grid) coordinates(meuse) - ~x+y

Re: [R-sig-Geo] Calculating 95th percentile within polygons

2011-10-18 Thread Edzer Pebesma
Zia, You may want to rethink the question. Each realization has a 95 percentile within a particular polygon. Over the set of realizations of some aggregated value for a polygon, you can take a 95 percentile. These are two different things. The first is a spatial aggregation, the second an

Re: [R-sig-Geo] Calculating 95th percentile within polygons

2011-10-18 Thread Zia Ahmed
Your are correct. Now, what I am going to do: first calculate 95th percentile of all realizations at prediction grid and then calculate the mean for each polygon. Is it possible to calculated weighted mean of the this 95th percentile? weight may be area of polygon or any value, for

Re: [R-sig-Geo] Calculating 95th percentile within polygons

2011-10-18 Thread Edzer Pebesma
On 10/18/2011 11:45 PM, Zia Ahmed wrote: Your are correct. Now, what I am going to do: first calculate 95th percentile of all realizations at prediction grid and then calculate the mean for each polygon. this implies you end up with one single value per polygon. Call it A. Is it possible