Agriculture Reference
In-Depth Information
Fig. 7.2 Sample selected with a GRTS scheme
> N < - 1000
> set.seed(200694)
> GRTS ¼ function(p,x,y){
+N ¼ length(p)
+n ¼ round(sum(p))
+ index ¼ 1:N
+s ¼ rep(0,times ¼ N)
+ att ¼ data.frame(x ¼ x,y ¼ y,mdcaty ¼ p,ids ¼ index)
+ design ¼ list(None ¼ list(panel ¼ c(Panel1 ¼ n),
seltype ¼ "Continuous",
+ caty.n ¼ c("Caty 1" ¼ n), over ¼ 0))
+ res ¼ grts(design,DesignID ¼ "Site",SiteBegin ¼ 1,type.
frame ¼ "finite",
+ src.frame¼"att.frame",in.shape¼NULL,sp.object¼NULL,att.
frame¼att,
+id¼NULL,xcoord¼"x",ycoord¼"y",stratum¼NULL,mdcaty¼"mdcaty",
+ startlev¼NULL,maxlev¼11,maxtry¼1000,shift.grid¼TRUE,
+ do.sample¼rep(TRUE, length(design)), shapefile¼FALSE,
+ prjfilename¼NULL, out.shape¼"sample")
+
s[res$ids]¼1
Search WWH ::




Custom Search