R/cap_design.default.R

Defines functions cap_design.default

Documented in cap_design.default

cap_design.default<-function(area,params,w=NA,plot=TRUE)
{
   if(!inherits(area,"createArea")) {stop('wrong area object specified!')}
   classes<-rep(NA,length(params))
   for(i in 1:length(params)) classes[i]<-class(params[[i]][[1]])
   if(all(is.na(w))) w<-rep(1/sum(classes=="createDemandSite"),sum(classes=="createDemandSite"))
   if(sum(classes=="createDemandSite")!=length(w)) {stop("the length of w must be equal to the number of demand site existing in the params!")}
   if(!inherits(plot,"logical")) {stop("plot arugement accepts logical values only!")}
   resault<-list()
   operation<-cap_design.base(area,params,w,plot)
   resault$operation<-operation
   resault$call<-match.call()
   class(resault)<-'cap_design'
   return(resault)
}

Try the WRSS package in your browser

Any scripts or data that you put into this service are public.

WRSS documentation built on May 30, 2022, 1:07 a.m.