mardi 23 mai 2017

Stratified sampling based on categorical raster data

I would like to sample 200 point locations within a thematic map using stratified random sampling. I would also like to define the sampling size for each category.

I have already accessed the raster attribute table and calculated the proportionate sample sizes for each category

ss<-200  #sample size
r <- ratify(r)
rat <- levels(r)[[1]] 
rat$count<-freq(r) #create new column with count for each class
rat$prop<-(ss/sum(rat$count)*rat$count) # proportionate sample

How do I pass the data into for example:

sampleStratified(x, size, exp=10, na.rm=TRUE, xy=FALSE, ext=NULL, sp=FALSE, ...)




Aucun commentaire:

Enregistrer un commentaire