# NOT RUN {
data('frogsEM') #see example in ?EM().
data('nzp')
idst<- frogsEM[1:10,]
Cr<- frogsEM[-(1:10),]
yr<- unique(Cr$year)
nNoYear<- rep(NA,length(unique(Cr$year)))
hNoYear<- rep(NA,length(unique(Cr$year)))
for(i in 1:length(unique(Cr$year))){
CrYear<- Cr[Cr$year==unique(Cr$year)[i],] #Cr for that year
nNoYear[i]<- nrow(CrYear[CrYear$Pnat>=.5,]) #natural points for that year
hNoYear[i]<- nrow(CrYear[CrYear$Pnat<.5,]) #human points for that year
}
AV<- c(2,3,4.5,7.5,11,15,20,25) #alpha values
# }
# NOT RUN {
frogsLacro<- simulacro(INIDIST=idst,YEARS=yr,
BOUNDARY=nzp,NNAT=nNoYear,NANTH=hNoYear,
FACNAT=10,
A=AV,X=seq(.1,30,.1),
TRUEANTH=TRUE,TRUEDB=Cr,PROB=.5,
ITERATIONS=10,HSM=nzp)
# }
Run the code above in your browser using DataLab