content
stringlengths
0
14.9M
filename
stringlengths
44
136
#' @export ssea.oneway<-function(number.group,mc,sigma,n.weight,ci.width,type=c('s','b'), alpha=0.05){ type<-match.arg(type) k<-dim(mc)[1] r<-number.group v<-sigma^2 o<-0 n=2 ############## !!!!!!!!!!! while(o!=1){ #print(n) mn<-n*n.weight s<-c() for (i in 1:k){ s<-c(s, sqrt( v*( sum( ((mc[i,])^2)/mn) ) ) ) } if (match.arg(type)=='b'){ st<-qt(1 - alpha/(2*k), sum(mn)-r) }else{ st<-sqrt((r - 1)*qf(1 - alpha, r - 1, sum(mn)-r)) } if( sum((2*st*s)<=ci.width)==k ){ o=1 }else{ n=n+1 } } sample.size<-cbind(1:r,mn) colnames(sample.size)<-c('treatment','n_i') ci<-cbind(1:k,st*s*2,ci.width ) colnames(ci)<-c('Contrast','width of CI','expected CI') out<-list(CI=ci, n=sample.size ) return(out) }
/scratch/gouwar.j/cran-all/cranData/ALSM/R/17_ss.towway.R
#' @export aligned.dot.plot2<-function(y,factor1,factor2=NULL){ factor1<-as.numeric(factor1) #factor2<-match.arg(factor2) if (!is.null(factor2)){ factor2<-as.numeric(factor2) factor1<-as.numeric(factor1) ufactor1<-unique(factor1) ufactor2<-unique(factor2) ci<-c() cj<-c() for(i in ufactor1){ for(j in ufactor2){ ci<-c(ci,ufactor1[i]) cj<-c(cj,ufactor2[j]) } } rn<-paste0(ci,' - ' ,cj) yy=y[factor1==ufactor1[1] & factor2==ufactor2[1]] plot(yy,rep(1,length(yy)) ,yaxt='n',col='white', xlab=c('') , ylim =c(0,length(table(factor1))*length(table(factor2))),xlim=range(y),ylab=c('treatment') ) axis(2,1:c(length(table(factor1))*length(table(factor2)) ) , labels = rn) abline(h=1:c(length(table(factor1))*length(table(factor2))), lty = 2,col='gray75') s=1 for(i in ufactor1){ for(j in ufactor2){ yy=y[factor1==ufactor1[i] & factor2==ufactor2[j]] points(yy,rep(s,length(yy))) s=s+1 } } }else{####################################### factor1=as.numeric(factor1) ufactor1<-unique(factor1) ci<-c() for(i in ufactor1){ ci<-c(ci,ufactor1[i]) } rn<-paste0(ci) yy=y[factor1==ufactor1[1] ] plot(yy,rep(1,length(yy)) ,yaxt='n',col='white', xlab=c('') , ylim =c(0,length(table(factor1))+.5 ),xlim=range(y),ylab=c('treatment') ) axis(2,1:c(length(table(factor1)) ) , labels = rn) abline(h=1:c(length(table(factor1))), lty = 2,col='gray75') s=1 for(i in ufactor1){ yy=y[factor1==ufactor1[i] ] points(yy,rep(s,length(yy))) s=s+1 } } }
/scratch/gouwar.j/cran-all/cranData/ALSM/R/19_aligned.dot.plot.R
#' @export towway.ci<-function(y,x1,x2,mc=NULL,mp=NULL,mt=NULL,mse=NULL,alpha=0.05){ if (1==1 ){ a<-length(table(x1)) b<-length(table(x2)) ab<-c(a,b) mean.a<-tapply(y,x1,mean) mean.b<-tapply(y,x2,mean) m<-list(mean.a,mean.b) rv.a<-as.integer(names(mean.a)) rv.b<-as.integer(names(mean.b)) n<-aggregate(y,list(x1,x2),length)[,3] m.n<-tapply(y,list(x1,x2),length) m.mean<-tapply(y,list(x1,x2),mean) ma<-apply(m.mean,1,mean) mb<-apply(m.mean,2,mean) out.t.c<-NULL out.f.a<-NULL out.f.b<-NULL out.bt.a<-NULL out.bt.b<-NULL out.c.a<-NULL out.s.a<-NULL out.sb.a<-NULL out.t<-NULL out.t.s<-NULL out.t.sb<-NULL out.tpb<-NULL out.tpt<-NULL ################## chekkkkkkkkk if (sum(n==1)==length(y) ) { fit <- lm(y ~ factor(x1)+factor(x2))######!!!!! df.er=(a-1)*(b-1) }else{ fit <- lm(y ~ factor(x1)*factor(x2))######!!!!! df.er=length(y)-a*b } ##################### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # if ( is.null(mse) ){ mse<-(deviance(fit))/(fit$df.residual) #} ci.a<-c() cj.a<-c() for (i in 1:(a-1)){ ii<-i+1 for ( j in ii:a){ ci.a<-c(ci.a,rv.a[i]) cj.a<-c(cj.a,rv.a[j]) } } rn.a<-paste0(ci.a,'-' ,cj.a) ci.b<-c() cj.b<-c() for (i in 1:(b-1)){ ii<-i+1 for ( j in ii:b){ ci.b<-c(ci.b,rv.b[i]) cj.b<-c(cj.b,rv.b[j]) } } rn.b<-paste0(ci.b,'-' ,cj.b) ############### T.a<-(qtukey(1-alpha,a,df.er))/sqrt(2) T.b<-(qtukey(1-alpha,b,df.er))/sqrt(2) t.a<-qt(1-alpha/2,df.er) t.b<-qt(1-alpha/2,df.er) } ############################################ factor level row.a<-as.integer(names(mean.a)) row.b<-as.integer(names(mean.b)) out.f.a<-matrix(1,1,3) out.f.b<-matrix(1,1,3) for ( i in 1:a){ s.a<-sqrt((mse*(apply(1/m.n,1,sum)[i]) )/(b^2)) out<-cbind(level=row.a[i],lower=ma[i]-t.a*s.a,upper=ma[i]+t.a*s.a) out.f.a<-rbind(out.f.a,out) } out.f.a<- out.f.a[-1,] for ( i in 1:b){ s.b<-sqrt((mse*(apply(1/m.n,2,sum)[i]) )/(a^2)) out<-cbind(level=row.b[i],lower=mb[i]-t.b*s.b,upper=mb[i]+t.b*s.b) out.f.b<-rbind(out.f.b,out) } out.f.b<- out.f.b[-1,] ############################ tukey a d.a<-ma[ci.a]-ma[cj.a] s.a<-c() for ( i in 1:length(ci.a)){ ss<-sum(apply(1/m.n,1,function(x) sum(x) )[c(ci.a[i],cj.a[i])]) s.a<-c(s.a,sqrt( (mse*ss)/(b^2) ) ) } out.t.a<-cbind(d.a,lower=d.a-T.a*s.a,upper=d.a+T.a*s.a) row.names(out.t.a)<-rn.a d25=out.t.a qwe<-dim(d25)[1] plot(-10,-10,ylim=c(0,dim(d25)[1]+.5),yaxt='n',xlim=range(d25[,2:3]),xlab='',ylab='',main=paste("CI Tukey factor x1")) ####### -10 -10 !!!!!! axis(2,1:qwe,labels=row.names(d25)) arrows(d25[,2],1:qwe,d25[,3],1:qwe,code=3,angle = 90,length = .1) ############################ tukey b d.b<-mb[ci.b]-mb[cj.b] s.b<-c() for ( i in 1:length(ci.b)){ ss<-sum(apply(1/m.n,2,sum)[c(ci.b[i],cj.b[i])] ) s.b<-c(s.b,sqrt((mse*ss)/(a^2)) ) } out.t.b<-cbind(d.b,lower=d.b-T.b*s.b,upper=d.b+T.b*s.b) row.names(out.t.b)<-rn.b d25=out.t.b qwe<-dim(d25)[1] plot(-10,-10,ylim=c(0,dim(d25)[1]+.5),yaxt='n',xlim=range(d25[,2:3]),xlab='',ylab='',main=paste("CI Tukey factor x2")) ####### -10 -10 !!!!!! axis(2,1:qwe,labels=row.names(d25)) arrows(d25[,2],1:qwe,d25[,3],1:qwe,code=3,angle = 90,length = .1) ################################ BON tow a g<-choose(a,2) ###!!!!!!!!! t<-qt(1-alpha/(2*g),df.er) out.bt.a<-cbind(d.a,lower=d.a-t*s.a,upper=d.a+t*s.a) row.names(out.bt.a)<-rn.a ################################ BON tow b g<-choose(b,2) ###!!!!!!!!! t<-qt(1-alpha/(2*g),df.er) out.bt.b<-cbind(d.b,lower=d.b-t*s.b,upper=d.b+t*s.b) row.names(out.bt.b)<-rn.b if (!is.null(mc)){#################### if is null mc mm<-list(ma,mb) z<-dim(mc)[1] ss<-apply(mc!=0,1,any) zz<-c(1:z)[-c(1:(z/3)*3)] qq<-ss[zz] e<-rep(1:2,length=length(qq))[qq] mc2<-mc[ ss,] z<-dim(mc2)[1] if ( !sum(qq)==length(zz) ) { ############################## contrast z<-dim(mc2)[1] e<-rep(1:2,length=length(qq))[qq] t<-qt(1-alpha/2,df.er) g<-z/2 tb<-qt(1-alpha/(2*g),df.er) out.c.a<-matrix(1,1,4) out.s.a<-matrix(1,1,4) out.sb.a<-matrix(1,1,4) for( i in 1:c(z/2)){ l<-sum( (mm[[e[i]]][mc2[i*2-1,]])*(mc2[i*2,]) ) ss<-sum( (mc2[i*2,]^2)*(apply(1/m.n,e[i],sum)[mc2[i*2-1,] ] ) ) s.a<-sqrt( (mse/(rev(ab)[e[i]]^2))*ss ) s<-sqrt((ab[e[i]]-1)*qf(1-alpha,ab[e[i]]-1,df.er ) ) out<-cbind(num=i,L=l,lower=l-t*s.a,upper=l+t*s.a) out.c.a<-rbind(out.c.a,out) out<-cbind(num=i,L=l,lower=l-s*s.a,upper=l+s*s.a) out.s.a<-rbind(out.s.a,out) out<-cbind(num=i,L=l,lower=l-tb*s.a,upper=l+tb*s.a) out.sb.a<-rbind(out.sb.a,out) } out.c.a<-out.c.a[-1,] out.s.a<-out.s.a[-1,] out.sb.a<-out.sb.a[-1,] }else{ z<-dim(mc)[1] out.t.s<-matrix(1,1,4) out.t.c<-matrix(1,1,4) out.t.sb<-matrix(1,1,4) s<-sqrt( (a*b -1)*qf(1-alpha,a*b-1,df.er) ) g<-z/3 t<-qt(1-alpha/(2*g),df.er) ttt<-qt(1-alpha/(2),df.er) for ( i in 1:(z/3)){ l<-sum(apply(mc[c(i*3-2):c(i*3),],2,function(x) sum(m.mean[x[1],x[2]]*x[3]) )) se2<-mse*sum(apply(mc[c(i*3-2):c(i*3),],2,function(x) sum((x[3]^2)/m.n[x[1],x[2]]) )) se<-sqrt(se2) out<-cbind(num=i,L=l,lower=l-s*se,upper=l+s*se) out.t.s<-rbind(out.t.s,out) out<-cbind(num=i,L=l,lower=l-ttt*se,upper=l+ttt*se) out.t.c<-rbind(out.t.c,out) out<-cbind(num=i,L=l,lower=l-t*se,upper=l+t*se) out.t.sb<-rbind(out.t.sb,out) } out.t.s<-out.t.s[-1,] out.t.sb<-out.t.sb[-1,] out.t.c<-out.t.c[-1,] } ### treat } ### end mc if( !is.null(mt)){#####################teratment BON out.t<-matrix(1,ncol=5) z<-dim(mt)[1] for ( i in 1:z){ s<-sqrt(mse/(m.n[ mt[i,1], mt[i,2]])) t<-qt(1-alpha/(2*z),df.er) e<-m.mean[ mt[i,1], mt[i,2] ] out<-cbind(i=mt[i,1],j=mt[i,2],estimate=e,lower= e-t*s , upper= e+t*s ) out.t<-rbind(out.t,out) } out.t<-out.t[-1,] } if( !is.null(mp)){#####################teratment out.tpb<-matrix(1,ncol=3) out.tpt<-matrix(1,ncol=3) z<-dim(mp)[1] Tu<-(qtukey(1-alpha,a*b,df.er))/sqrt(2) tb<-qt(1-alpha/(2*z),df.er) for ( i in 1:z){ s<-sqrt(mse*( 1/(m.n[ mp[i,1], mp[i,2] ])+1/(m.n[ mp[i,3], mp[i,4] ]))) e<- (m.mean[ mp[i,1], mp[i,2]]-m.mean[ mp[i,3], mp[i,4]] ) out<-cbind(estimate=e,lower= e-tb*s , upper= e+tb*s ) out.tpb<-rbind(out.tpb,out) out<-cbind(estimate=e,lower= e-Tu*s , upper= e+Tu*s ) out.tpt<-rbind(out.tpt,out) } out.tpb<-out.tpb[-1,] out.tpt<-out.tpt[-1,] } o<-list( factor.a=out.f.a, factor.b=out.f.b, bonferroni.simultaneous.pairwise.a=out.bt.a, bonferroni.simultaneous.pairwise.b=out.bt.b, tukey.simultaneous.pairwise.a=out.t.a, tukey.simultaneous.pairwise.b=out.t.b, NOT.simultaneous.Contrast=out.c.a, Sheffe.simultaneous.Contrast=out.s.a, bonferroni.simultaneous.Contrast=out.sb.a, treatment.Bonferroni=out.t, bonferroni.simultaneous.pairwise.treatment=out.tpb, tukey.simultaneous.pairwise.treatment=out.tpt, NOT.simultaneous.Contrast.treatment=out.t.c, Sheffe.simultaneous.Contrast.treatment=out.t.s, bonferroni.simultaneous.Contrast.treatment=out.t.sb) return(o) }########################################################### end function
/scratch/gouwar.j/cran-all/cranData/ALSM/R/19_towway.ci.R
#' @export MLS<-function(MSE1,df1,c1,MSE2,df2,c2,alpha=0.05){ f1=qf(1-alpha/2,df1,Inf) f2=qf(1-alpha/2,df2,Inf) f3=qf(1-alpha/2,Inf,df1) f4=qf(1-alpha/2,Inf,df2) f5=qf(1-alpha/2,df1,df2) f6=qf(1-alpha/2,df2,df1) g1<-1-1/f1 g2<-1-1/f2 g3<-( ((f5-1)^2)-((g1*f5)^2)-((f4-1)^2) )/f5 g4<-f6*( (((f6-1)/f6)^2) -1*(((f3-1)/f6)^2) -g2^2) hl<-sqrt( ((g1*c1*MSE1)^2)+(((f4-1)*c2*MSE2)^2)-1*((g3*c1*c2*MSE1*MSE2)) ) hu<-sqrt( (((f3-1)*c1*MSE1 )^2)+((g2*c2*MSE2 )^2)-1*(( g4*c1*c2*MSE1*MSE2)) ) l=c1*MSE1+c2*MSE2 L=sum(l) lower<-L-hl upper<-L+hu return(cbind(estimate=L,lower=lower,upper=upper)) }
/scratch/gouwar.j/cran-all/cranData/ALSM/R/25_MLS.R
#' @export #' @import car #' #' onerandom<-function(y,treatment,alpha){ treatment<-factor(treatment) aov=Anova(lm(y ~treatment ), type=2) mse2<-aov[,1]/aov[,2] mse<-mse2[2] mstr<-mse2[1] r<-aov[1,2]+1 n<-(aov[2,2]+r)/r ########################################################### s<-sqrt(mstr/(r*n)) lower<-mean(y)-qt(1-alpha/2,r-1)*s upper<-mean(y)+qt(1-alpha/2,r-1)*s out.mu<-cbind(estimate=mean(y),lower=lower,upper=upper) ###################### l=((mstr/mse)*(1/qf(1-alpha/2,r-1,r*(n-1)))-1)/n u=((mstr/mse)*(1/qf(alpha/2,r-1,r*(n-1)))-1)/n lower<-l/(l+1) upper<-u/(1+u) out.prop.sigma2.mu<-cbind(lower=lower,upper=upper) ############################################################### lower<-(r*(n-1)*mse)/(qchisq(1-alpha/2,r*(n-1))) upper<-(r*(n-1)*mse)/(qchisq(alpha/2,r*(n-1))) out.sigma2<-cbind(lower=lower,upper=upper) ########################## out1<-satterthwaite(c=c(1/n,-1/n),MSE=c(mstr,mse),df=c(r-1,r*(n-1)),alpha=alpha) out2<-MLS(MSE1=mstr,df1=r-1,c1=1/n,MSE2=mse,df2=r*(n-1),c2=-1/n,alpha=alpha) o<-list(anova=aov,mu=out.mu,prop.sigma2.mu=out.prop.sigma2.mu, sigma2=out.sigma2,sigma2.mu.satterthwaite=out1, sigma2.mu.MLS= out2 ) return(o) }
/scratch/gouwar.j/cran-all/cranData/ALSM/R/25_onerandom.R
#' @export satterthwaite<-function(c,MSE,df,alpha=0.05){ l=c*MSE L=sum(c*MSE) dff<-((L^2)/sum((l^2)/df)) dff2<-round(dff) if (dff2==0) dff2=1 lower<-(dff*L)/(qchisq(1-alpha/2,(dff2 ))) upper<-(dff*L)/(qchisq(alpha/2,(dff2))) return(cbind(estimate=L,df=(dff),lower=lower,upper=upper)) }
/scratch/gouwar.j/cran-all/cranData/ALSM/R/25_satterthwaiteeeee.R
#' @export bftest<-function(fit,group,alpha=.05){ f<-fit$fitted e<-fit$res e1<-e[group==unique(group)[1]] e2<-e[group==unique(group)[2]] d1<-abs(e1-median(e1)) d2=abs(e2-median(e2)) n1<-length(e1) n2<-length(e2) n<-length(group)################# deghat, barasi, neveshtan stop s=sqrt( ( (n1-1)*var(d1)+ (n2-1)*var(d2) )/(n-2)) t=(mean(d1)-mean(d2))/(s*sqrt((1/n1)+(1/n2)) ) out<-cbind(t.value=abs(t),P.Value=2*(1-pt(abs(t),n-2)),alpha=alpha,df=(n-2))###???? return(out) }
/scratch/gouwar.j/cran-all/cranData/ALSM/R/3_bftest.R
#' @export ############ you can add mse log lik --------- boxcox.sse<-function(x,y,l=seq(-2,2,.1)){ s<-c() l<-l[l!=0] k2=(prod(y))^(1/length(y)) for(j in 1:length(l)){ k1=1/( (l[j])*(k2^(l[j]-1)) ) w=k1*((y^l[j]) -1) s<-c(s,deviance(lm(w~x))) } w=k2*log(y) s0<-c(deviance(lm(w~x))) s<-c(s,s0) l<-c(l,0) out<-data.frame(lambda=l,SSE=s) out<-out[order(l),] plot(out,ylab = 'SSE',xlab=expression(lambda),type='l') return(out) }
/scratch/gouwar.j/cran-all/cranData/ALSM/R/3_boxcox.sse.R
#' @export #' @importFrom graphics lines par plot abline arrows axis barplot boxplot hist text title segments points #' @importFrom stats anova deviance df.residual lm median predict pt qf qt var pf ptukey qnorm qqline qqnorm qtukey rstudent sd TukeyHSD aov aggregate cor qchisq #' @importFrom leaps leaps #' @importFrom car Anova ci.reg<-function(model, newdata, type = c("b", "s","w","n","m","nm","gn"), alpha = 0.05,m=1){ type<-match.arg(type) newdata<-as.data.frame(newdata) if ( dim(newdata)[2] == length(names(model$coeff)) ){ colnames(newdata)<-names(model$coeff) }else{ colnames(newdata)<-names(model$coeff)[-1] } CI<-predict(model, newdata, se.fit = T) g<-nrow(newdata) p<-ncol(newdata)+1 syh<-CI$se.fit spred<-sqrt( CI$residual.scale^2 + (CI$se.fit)^2 ) # (2.38) spredmean<-sqrt( (CI$residual.scale^2)/m + (CI$se.fit)^2 ) b<-qt(1 - alpha/(2*g), model$df) # B = (4.9a) s<-sqrt(g * qf(1 - alpha, g, model$df)) # S = (4.8a) w<-sqrt(p*qf(1 - alpha, p, model$df)) if (match.arg(type) == "b") { s<-syh z<-b }else if(match.arg(type) == "s") { s<-spred z<-s }else if(match.arg(type) == "w") { s<-syh z<-w }else if(match.arg(type) == "n") { s<-spred z<-qt(1 - alpha/2, model$df) }else if(match.arg(type) == "nm") { s<-spredmean z<-qt(1 - alpha/2, model$df) }else if(match.arg(type) == "m") { s<-syh z<-qt(1 - alpha/2, model$df) }else if(match.arg(type) == "gn") { s<-spred z<-b} x<-data.frame(newdata,Fit=CI$fit,Lower.Band=CI$fit-z*s,Upper.Band=CI$fit+z*s) return(x) }
/scratch/gouwar.j/cran-all/cranData/ALSM/R/6_ci.reg.R
#' @export AICp<- function(model){ n <- sum(anova(model)[,1])+1 p <- n-df.residual(model) #print(n) #print(p) return(n*log(deviance(model))-n*log(n)+2*p) }
/scratch/gouwar.j/cran-all/cranData/ALSM/R/9_AICp.R
#' @export BestSub<-function(x,y,method=c('r2','r2adj','sse','cp','press','aic','sbc'),num=2){ method<-match.arg(method) x<-as.matrix(x) y<-as.matrix(y) m<-model.s(x,y) if (match.arg(method) == "r2") { q<-dim(m)[2]-5 n<-cbind(1:dim(m)[1],m[,1],m[,q])[order(m[,q],decreasing = T),] g<-unlist(tapply(n[,1],n[,2],function(x) x[1:num])) p<-rep(2:max(m[,1]),each=num)[!is.na(g)] g<-g[!is.na(g)] return(cbind(p,m[g,][,-1])) }else if(match.arg(method) == "r2adj") { q<-dim(m)[2]-4 n<-cbind(1:dim(m)[1],m[,1],m[,q])[order(m[,q],decreasing = T),] g<-unlist(tapply(n[,1],n[,2],function(x) x[1:num])) p<-rep(2:max(m[,1]),each=num)[!is.na(g)] g<-g[!is.na(g)] return(cbind(p,m[g,][,-1])) }else if(match.arg(method) == "sse") { q<-dim(m)[2]-6 }else if(match.arg(method) == "cp") { q<-dim(m)[2]-3 }else if(match.arg(method) == "aic") { q<-dim(m)[2]-2 }else if(match.arg(method) == "sbc") { q<-dim(m)[2]-1 }else if(match.arg(method) == "press") { q<-dim(m)[2]-0 } n<-cbind(1:dim(m)[1],m[,1],m[,q])[order(m[,q],decreasing = F),] g<-unlist(tapply(n[,1],n[,2],function(x) x[1:num])) p<-rep(2:max(m[,1]),each=num)[!is.na(g)] g<-g[!is.na(g)] return(cbind(p,m[g,][,-1])) }
/scratch/gouwar.j/cran-all/cranData/ALSM/R/9_BestSub.R
#' @export SBCp<- function(model){ n <- sum(anova(model)[,1])+1 p <- n-df.residual(model) #print(n) #print(p) return(n*log(deviance(model))-n*log(n)+(log(n))*p) }
/scratch/gouwar.j/cran-all/cranData/ALSM/R/9_SBCp.R
#' @export #' cpc<- function(r,f){ n <- sum(anova(f)[,1])+1 p <- n-df.residual(r) #print(n) #print(p) return((deviance(r)/(deviance(f)/df.residual(f)))-(n-2*p)) }
/scratch/gouwar.j/cran-all/cranData/ALSM/R/9_cpc.R
#' @export #' @import leaps model.s<-function(x,y){ n<-ncol(x) x<-as.matrix(x) y<-as.vector(y) xaic<-c() xsbc<-c() xpress<-c() xsse<-c() c<-leaps(x,y)$which for (i in 1:nrow(c)){ model<-lm(y~ x[,(1:n)[c[i,]==T]] ) smodel<-summary(model) xaic<-c(xaic,AICp(model)) xsbc<-c(xsbc,SBCp(model)) xpress<-c(xpress,pressc(model)) xsse<-c(xsse,deviance(model)) # xcp<-c(xcp, cpc(model) ) } m1 <- leaps(x,y,method='Cp') m2 <- leaps(x,y,method='r2') m3 <- leaps(x,y,method='adjr2') cbind(p=m1$size,m1$which,SSEp=xsse,r2=m2$r2,r2.adj=m3$adjr2,Cp=m1$Cp,AICp=xaic,SBCp=xsbc,PRESSp=xpress) }
/scratch/gouwar.j/cran-all/cranData/ALSM/R/9_model.s.R
#' @export ######## DO NOT CALCULATE CP****************************************** modelval<-function(building.set,response.building, prediction.set, response.prediction){ building.set<-as.matrix(building.set) response.building<-as.matrix(response.building) prediction.set<-as.matrix(prediction.set) response.prediction<-as.matrix(response.prediction) model1<-lm(response.building~building.set) model2<-lm(response.prediction~prediction.set) smodel1<-summary(model1)$coeff[,1:2] smodel2<-summary(model2)$coeff[,1:2] #leaps(model.buildi11g.set,y,method = 'Cp') #cp1<-cpc(model1) #cp2<-cpc(model2) p1<-pressc(model1) p2<-pressc(model2) a1<-AICp(model1) a2<-AICp(model2) s1<-SBCp(model1) s2<-SBCp(model2) r1<-summary(model1)$r.squared r2<-summary(model2)$r.squared r2a1<-summary(model1)$adj.r.squared r2a2<-summary(model2)$adj.r.squared Model.Training<-c(smodel1[,1],smodel1[,2],deviance(model1)/df.residual(model1),r1,r2a1,a1,s1,p1) Model.Validation<-c(smodel2[,1],smodel2[,2],deviance(model2)/df.residual(model2),r2,r2a2,a2,s2,p2) v<-cbind(Model.Training,Model.Validation) namE<-paste('b',0:ncol(building.set),sep = "") namSE<-paste('SE b',0:ncol(building.set),sep = "") rownames(v)<-c(namE,namSE,'MSE','R2','R2.adj','AICp','SBCp','PRESSp') return(v) }
/scratch/gouwar.j/cran-all/cranData/ALSM/R/9_modelval.R
#' @export plotmodel.s<-function(x,y){ n<-ncol(x) x<-as.matrix(x) y<-as.vector(y) xaic<-c() xsbc<-c() xpress<-c() c<-leaps(x,y)$which for (i in 1:nrow(c)){ model<-lm(y~ x[,(1:n)[c[i,]==T]] ) #smodel<-summary(model) xaic<-c(xaic,AICp(model)) xsbc<-c(xsbc,SBCp(model)) xpress<-c(xpress,pressc(model)) } m1 <- leaps(x,y,method='Cp') m2 <- leaps(x,y,method='r2') m3 <- leaps(x,y,method='adjr2') p<-m1$size #cbind(p=m1$size,m1$which,r2=m2$r2,r2.adj=m3$adjr2,Cp=m1$Cp,AICp=xaic,SBCp=xsbc,PRESSp=xpress) #par(mfrow=c(3,2)) par(mfrow=c(1,1)) e<-max(p) plot(m2$r2 ~ p, xlab = "p", ylab = "R2",main='plot 1 of 6') lines(2:e, tapply(m2$r2, p, max), lwd = 2,col=2) plot(m3$adjr2 ~ p, xlab = "p", ylab = "R2adj",main='plot 2 of 6') lines(2:e, tapply(m3$adjr2, p, max), lwd = 2,col=2) plot(xaic ~ p, xlab = "p", ylab = "AIC",main='plot 3 of 6') lines(2:e, tapply(xaic, p, min), lwd = 2,col=2) plot(xsbc ~ p, xlab = "p", ylab = "SBC",main='plot 4 of 6') lines(2:e, tapply(xsbc, p, min), lwd = 2,col=2) plot(m1$Cp ~ p, xlab = "p", ylab = "Cp",main='plot 5 of 6') lines(2:e, tapply(m1$Cp, p, min), lwd = 2,col=2) plot(xpress ~ p, xlab = "p", ylab = "PRESS",main='plot 6 of 6') lines(2:e, tapply(xpress, p, min), lwd = 2,col=2) #par(mfrow=c(1,1)) }
/scratch/gouwar.j/cran-all/cranData/ALSM/R/9_plot.model.s.R
#' @export pressc<-function(fit){ x<-cbind( rep(1, nrow(as.matrix(fit$model[,-1])) ),fit$model[,-1] ) x<-as.matrix(x) h<-x%*%solve(t(x)%*%x)%*%(t(x)) e<-fit$residuals return(sum( (e/(1-diag(h)))^2 ) ) }
/scratch/gouwar.j/cran-all/cranData/ALSM/R/9_pressc.R
#' @export normal.cor.test<-function(residuals,MSE){ w<-1:length(residuals) r<-cor(sort(residuals), sqrt(MSE)*(qnorm((w-0.375)/(length(residuals)+.25))) ) return(r) }
/scratch/gouwar.j/cran-all/cranData/ALSM/R/normal.cor.test.R
#' Transform the array to the model matrix #' #' The internal function to make the model matrix corresponded to linear #' predictor model from the array (vector) containg coordinates of stress factors. #' #' @keywords internal #' @importFrom stats model.matrix ExtendedForm <- function(array, formula, nf) { terms <- attr(terms(formula), "term.labels") mtx <- as.data.frame(matrix(array, ncol = nf)) colnames(mtx) <- terms[1:nf] out <- model.matrix(formula, mtx) } #' Calculates the prediction variance at the particular use condition #' #' The internal function to calculate the prediction variance #' #' @keywords internal PreVar <- function(location, formula, nf, infMtxInv) { # Calculates the prediction variance in a particular use condition use <- ExtendedForm(location, formula, nf) as.numeric(use %*% infMtxInv %*% t(use)) } #' Perform the k-means clustering and make design table #' #' The internal function to perform the k-means clustering and make design table. #' #' @keywords internal #' @importFrom stats kmeans kmeansCls <- function(Mtx, nCls) { kmeansOut <- kmeans(Mtx, nCls) Tbl <- cbind(kmeansOut$centers, kmeansOut$size) colnames(Tbl)[ncol(Tbl)] <- paste("allocation") Tbl } #' Objective function of D optimal design with right censoring #' #' The internal function to calculate the objective function value of #' D optimal design with right censoring plan. #' #' @keywords internal Dobj.rc <- function(x, formula, coef, nf, tc, alpha) { X <- ExtendedForm(x, formula, nf) b <- coef eta <- X %*% b #linear predictor phi <- 1 - exp(- exp(eta) * tc ^ alpha) W <- diag(phi[, 1]) XWX <- t(X) %*% W %*% X det(XWX) } #' Objective function of U optimal design with right censoring #' #' The internal function to calculate the objective function value of #' U optimal design with right censoring plan. #' #' @keywords internal #' @importFrom methods is Uobj.rc <- function(x, formula, coef, nf, tc, alpha, useCond) { X <- ExtendedForm(x, formula, nf) b <- coef eta <- X %*% b #linear predictor phi <- 1 - exp(- exp(eta) * tc ^ alpha) W <- diag(phi[, 1]) XWX <- t(X) %*% W %*% X c <- try(qr.solve(XWX), silent = TRUE) if (is(c, "try-error")) return("cannot calculated ; information matrix is near singular") else PreVar(location = useCond, formula = formula, nf = nf, infMtxInv = c) } #' Objective function of I optimal design with right censoring #' #' The internal function to calculate the objective function value of #' I optimal design with right censoring plan. #' #' @keywords internal #' @importFrom methods is Iobj.rc <- function(x, formula, coef, nf, tc, alpha, useLower, useUpper) { X <- ExtendedForm(x, formula, nf) b <- coef eta <- X %*% b #linear predictor phi <- 1 - exp(- exp(eta) * tc ^ alpha) W <- diag(phi[, 1]) XWX <- t(X) %*% W %*% X c <- try(qr.solve(XWX), silent = TRUE) if (is(c, "try-error")) return("cannot calculated ; information matrix is near singular") else { # numerical integration intgratedPV <- cubature::adaptIntegrate(PreVar, lowerLimit = useLower, upperLimit = useUpper, formula = formula, nf = nf, infMtxInv = c)$integral volume <- 1 for (i in 1:nf) volume <- volume * (useUpper[i] - useLower[i]) intgratedPV / volume } } #' Design evaluation with right censoring. #' #' \code{\link{alteval.rc}} calculates the objective function value #' (D, U or I) for a given design with right censoring plan. #' #' @param designTable a data frame containing the coordinates and the number of #' allocation of each design point. The design created by either #' \code{\link{altopt.rc}} or \code{\link{altopt.ic}} or any design matrix #' with the same form as those can be provided for this argument. #' @param optType the choice of \code{"D"}, \code{"U"} and \code{"I"} optimality. #' @param tc the censoring time. #' @param nf the number of stress factors. #' @param alpha the value of the shape parameter of Weibull distribution. #' @param formula the object of class formula which is the linear predictor model. #' @param coef the numeric vector containing the coefficients of each term in \code{formula}. #' @param useCond the numeric vector of use condition. #' It should be provided when \code{optType} is \code{"U"}. The length of the vector #' should be same as the number of stress factors. #' @param useLower the numeric vector of lower bound of use region. #' It should be provided when \code{optType} is \code{"I"}. The length of the vector #' should be same as the number of stress factors. #' @param useUpper the numeric vector of upper bound of use region. #' It should be provided when \code{optType} is \code{"I"}. The length of the vector #' should be same as the number of stress factors. #' @return The objective function value corresponded by \code{optType} #' for a given design with right censoring plan. #' @seealso \code{\link{altopt.rc}} #' @examples #' # Evaluation of factorial design for right censoring. #' x1 <- c(0, 1, 0, 1) #' x2 <- c(0, 0, 1, 1) #' allocation <- c(25, 25, 25, 25) #' facDes <- data.frame(x1, x2, allocation) #' #' alteval.rc(facDes, "D", 100, 2, 1, formula = ~ x1 + x2 + x1:x2, #' coef = c(0, -4.086, -1.476, 0.01)) #' #' alteval.rc(facDes, "U", 100, 2, 1, formula = ~ x1 + x2 + x1:x2, #' coef = c(0, -4.086, -1.476, 0.01), useCond = c(1.758, 3.159)) #' #' alteval.rc(facDes, "I", 100, 2, 1, formula = ~ x1 + x2 + x1:x2, #' coef = c(0, -4.086, -1.476, 0.01), useLower = c(1.458, 2.859), useUpper = c(2.058, 3.459)) #' @export alteval.rc <- function(designTable, optType, tc, nf, alpha, formula, coef, useCond, useLower, useUpper) { # Transform design to the single column array. x <- NULL for (col in (1:nf)) { for (row in (1:nrow(designTable))) { x <- c(x, rep(designTable[row, col], designTable[row, nf + 1])) } } if (optType == "D") value <- Dobj.rc(x, formula, coef, nf, tc, alpha) else if (optType == "U") value <- Uobj.rc(x, formula, coef, nf, tc, alpha, useCond) else if (optType == "I") value <- Iobj.rc(x, formula, coef, nf, tc, alpha, useLower, useUpper) else stop('Wrong optimization criteria') value } #' Optimal design with right censoring. #' #' \code{\link{altopt.rc}} creates D, U or I optimal design #' of the accelerated life testing with right censoring plan. #' #' @param optType the choice of \code{"D"}, \code{"U"} and \code{"I"} optimality. #' @param N the number of test units. #' @param tc the censoring time. #' @param nf the number of stress factors. #' @param alpha the value of the shape parameter of Weibull distribution. #' @param formula the object of class formula which is the linear predictor model. #' @param coef the numeric vector containing the coefficients of each term in \code{formula}. #' @param useCond the numeric vector of use condition. #' It should be provided when \code{optType} is \code{"U"}. The length of the vector #' should be same as the number of stress factors. #' @param useLower the numeric vector of lower bound of use region. #' It should be provided when \code{optType} is \code{"I"}. The length of the vector #' should be same as the number of stress factors. #' @param useUpper the numeric vector of upper bound of use region. #' It should be provided when \code{optType} is \code{"I"}. The length of the vector #' should be same as the number of stress factors. #' @param nOpt the number of repetition of optimization process. Default is 1. #' @param nKM the number of repetition of k-means clustering. Default is 20. #' @param nCls the number of clusters used for k-means clustering. If not specified, #' it is set as the number of parameters in the linear predictor model. #' @return A list with components #' \itemize{ #' \item{call:}{ the matched call.} #' \item{opt.design.ori:}{ the original optimal design.} #' \item{opt.value.ori:}{ the objective function value of \code{opt.design.ori}.} #' \item{opt.design.rounded:}{ the optimal design clustered by rounding in third decimal points.} #' \item{opt.value.rounded:}{ the objective function value of \code{opt.design.rounded}.} #' \item{opt.design.kmeans:}{ the optimal design clustered by \code{\link[stats]{kmeans}}.} #' \item{opt.value.kmeans:}{ the objective function value of \code{opt.design.kmeans}.} #' } #' @references #' { #' Monroe, E. M., Pan, R., Anderson-Cook, C. M., Montgomery, D. C. and #' Borror C. M. (2011) A Generalized Linear Model Approach to Designing #' Accelerated Life Test Experiments, \emph{Quality and Reliability Engineering #' International} \bold{27(4)}, 595--607 #' #' Yang, T., Pan, R. (2013) A Novel Approach to Optimal Accelerated Life Test #' Planning With Interval Censoring, \emph{Reliability, IEEE Transactions on} #' \bold{62(2)}, 527--536 #' } #' @seealso \code{\link[stats]{kmeans}}, \code{\link{alteval.rc}} #' @examples #' \dontrun{ #' # Generating D optimal design for right censoring. #' altopt.rc("D", 100, 100, 2, 1, formula = ~ x1 + x2 + x1:x2, #' coef = c(0, -4.086, -1.476, 0.01)) #' #' # Generating U optimal design for right censoring. #' altopt.rc("D", 100, 100, 2, 1, formula = ~ x1 + x2 + x1:x2, #' coef = c(0, -4.086, -1.476, 0.01), useCond = c(1.758, 3.159)) #' #' # Generating I optimal design for right censoring. #' altopt.rc("D", 100, 100, 2, 1, formula = ~ x1 + x2 + x1:x2, #' coef = c(0, -4.086, -1.476, 0.01), useLower = c(1.458, 2.859), #' useUpper = c(2.058, 3.459)) #' } #' @importFrom stats aggregate #' @importFrom stats optim #' @importFrom stats runif #' @importFrom methods is #' @export altopt.rc <- function(optType, N, tc, nf, alpha, formula, coef, useCond, useLower, useUpper, nOpt = 1, nKM = 30, nCls = NULL) { # function for optimization Opt.rc <- function() { xInit <- runif(nf * N, min = 0, max = 1) lb <- rep(0, nf * N) ub <- rep(1, nf * N) if (optType == "D") solution <- optim(xInit, Dobj.rc, NULL, formula, coef, nf, tc, alpha, method = "L-BFGS-B", lower = lb, upper = ub, control = list(fnscale = -1) # Maximization ) else if (optType == "U") solution <- optim(xInit, Uobj.rc, NULL, formula, coef, nf, tc, alpha, useCond, method = "L-BFGS-B", lower = lb, upper = ub) else if (optType == "I") solution <- optim(xInit, Iobj.rc, NULL, formula, coef, nf, tc, alpha, useLower, useUpper, method = "L-BFGS-B", lower = lb, upper = ub) else stop('Wrong optimization criteria') solution } # Repeat optimization with different initial points for (i in 1:nOpt) { Curr_sol <- Opt.rc() if (i == 1) Best_sol <- Curr_sol else if (optType == "D" && Curr_sol$value > Best_sol$value) Best_sol <- Curr_sol else if ((optType %in% c("U", "I")) && Curr_sol$value < Best_sol$value) Best_sol <- Curr_sol } terms <- attr(terms(formula), "term.labels") optDesignMtx <- as.data.frame(matrix(Best_sol$par, ncol = nf)) colnames(optDesignMtx) <- terms[1:nf] # Original result columnlist <- apply(optDesignMtx, 2, list) columnlist <- lapply(columnlist, unlist) optDesignOri <- aggregate(optDesignMtx, columnlist, length) while (length(optDesignOri) != (nf + 1)) optDesignOri <- optDesignOri[, -length(optDesignOri)] names(optDesignOri)[ncol(optDesignOri)] <- paste("allocation") optValueOri <- alteval.rc(optDesignOri, optType, tc, nf, alpha, formula, coef, useCond, useLower, useUpper) # Rounding result optDesignMtxRound <- round(optDesignMtx, digits = 3) columnlist <- apply(optDesignMtxRound, 2, list) columnlist <- lapply(columnlist, unlist) optDesignRound <- aggregate(optDesignMtxRound, columnlist, length) while (length(optDesignRound) != (nf + 1)) optDesignRound <- optDesignRound[, -length(optDesignRound)] names(optDesignRound)[ncol(optDesignRound)] <- paste("allocation") optValueRound <- alteval.rc(optDesignRound, optType, tc, nf, alpha, formula, coef, useCond, useLower, useUpper) # k-means result if (is.null(nCls)) nCls <- length(coef) for (j in 1:nKM) { curDesignKmeans <- kmeansCls(optDesignMtx, nCls) curValueKmeans <- alteval.rc(curDesignKmeans, optType, tc, nf, alpha, formula, coef, useCond, useLower, useUpper) if (j == 1) { optDesignKmeans <- curDesignKmeans optValueKmeans <- curValueKmeans } else if (optType == "D" && curValueKmeans > optValueKmeans) { optDesignKmeans <- curDesignKmeans optValueKmeans <- curValueKmeans } else if ((optType %in% c("U", "I")) && curValueKmeans < optValueKmeans) { optDesignKmeans <- curDesignKmeans optValueKmeans <- curValueKmeans } } # Creates output out <- list(call = match.call(), opt.design.ori = optDesignOri, opt.value.ori = as.numeric(optValueOri), opt.design.rounded = optDesignRound, opt.value.rounded = as.numeric(optValueRound), opt.design.kmeans = optDesignKmeans, opt.value.kmeans = ifelse (is(optValueKmeans, "character"), optValueKmeans, as.numeric(optValueKmeans)) ) out } #' Objective function of D optimal design with interval censoring #' #' The internal function to calculate the objective function value of #' D optimal design with interval censoring plan. #' #' @keywords internal Dobj.ic <- function(x, formula, coef, nf, t, k, alpha) { X <- ExtendedForm(x, formula, nf) b <- coef dt <- t / k eta <- X %*% b # linear predictor temp1 <- exp(2 * eta) temp2 <- diag(temp1[, 1]) sum <- 0 for(j in 1:k) { c <- ((j - 1) ^ alpha - j ^ alpha) * dt ^ alpha temp3 <- c ^ 2 * exp(- exp(eta) * (dt ^ alpha) * (j ^ alpha)) temp4 <- temp3 / (1 - exp(c * exp(eta))) sum = sum + temp4 } W <- sum[, 1] * temp2 # W plays a role of weight matrix XWX <- t(X) %*% W %*% X det(XWX) } #' Objective function of U optimal design with interval censoring #' #' The internal function to calculate the objective function value of #' U optimal design with interval censoring plan. #' #' @keywords internal #' @importFrom methods is Uobj.ic <- function(x, formula, coef, nf, t, k, alpha, useCond) { X <- ExtendedForm(x, formula, nf) b <- coef dt <- t / k eta <- X %*% b # linear predictor temp1 <- exp(2 * eta) temp2 <- diag(temp1[, 1]) sum <- 0 for(j in 1:k) { c <- ((j - 1) ^ alpha - j ^ alpha) * dt ^ alpha temp3 <- c ^ 2 * exp(- exp(eta) * (dt ^ alpha) * (j ^ alpha)) temp4 <- temp3 / (1 - exp(c * exp(eta))) sum = sum + temp4 } W <- sum[, 1] * temp2 # W plays a role of weight matrix XWX <- t(X) %*% W %*% X c <- try(qr.solve(XWX), silent = TRUE) if (is(c, "try-error")) return("cannot calculated ; information matrix is near singular") else PreVar(location = useCond, formula = formula, nf = nf, infMtxInv = c) } #' Objective function of U optimal design with interval censoring #' #' The internal function to calculate the objective function value of #' U optimal design with interval censoring plan. #' #' @keywords internal #' @importFrom methods is Iobj.ic <- function(x, formula, coef, nf, t, k, alpha, useLower, useUpper) { X <- ExtendedForm(x, formula, nf) b <- coef dt <- t / k eta <- X %*% b # linear predictor temp1 <- exp(2 * eta) temp2 <- diag(temp1[, 1]) sum <- 0 for(j in 1:k) { c <- ((j - 1) ^ alpha - j ^ alpha) * dt ^ alpha temp3 <- c ^ 2 * exp(- exp(eta) * (dt ^ alpha) * (j ^ alpha)) temp4 <- temp3 / (1 - exp(c * exp(eta))) sum = sum + temp4 } W <- sum[, 1] * temp2 # W plays a role of weight matrix XWX <- t(X) %*% W %*% X c <- try(qr.solve(XWX), silent = TRUE) if (is(c, "try-error")) return("cannot calculated ; information matrix is near singular") else { # numerical integration intgratedPV <- cubature::adaptIntegrate(PreVar, lowerLimit = useLower, upperLimit = useUpper, formula = formula, nf = nf, infMtxInv = c)$integral volume <- 1 for (i in 1:nf) volume <- volume * (useUpper[i] - useLower[i]) intgratedPV / volume } } #' Design evaluation with interval censoring. #' #' \code{\link{alteval.ic}} calculates the objective function value #' (D, U or I) for a given design with interval censoring plan. #' #' @param designTable a data frame containing the coordinates and the number of #' allocation of each design point. The design created by either #' \code{\link{altopt.rc}} or \code{\link{altopt.ic}} or any design matrix #' with the same form as those can be provided for this argument. #' @param optType the choice of \code{"D"}, \code{"U"} and \code{"I"} optimality. #' @param t the total testing time. #' @param k the number of time intervals. #' @param nf the number of stress factors. #' @param alpha the value of the shape parameter of Weibull distribution. #' @param formula the object of class formula which is the linear predictor model. #' @param coef the numeric vector containing the coefficients of each term in \code{formula}. #' @param useCond the numeric vector of use condition. #' It should be provided when \code{optType} is \code{"U"}. The length of the vector #' should be same as the number of stress factors. #' @param useLower the numeric vector of lower bound of use region. #' It should be provided when \code{optType} is \code{"I"}. The length of the vector #' should be same as the number of stress factors. #' @param useUpper the numeric vector of upper bound of use region. #' It should be provided when \code{optType} is \code{"I"}. The length of the vector #' should be same as the number of stress factors. #' @return The objective function value corresponded by \code{optType} #' for a given design with interval censoring plan. #' @seealso \code{\link{altopt.ic}} #' @examples #' # Evaluation of factorial design for interval censoring. #' x1 <- c(0, 1, 0, 1) #' x2 <- c(0, 0, 1, 1) #' allocation <- c(25, 25, 25, 25) #' facDes <- data.frame(x1, x2, allocation) #' #' alteval.ic(facDes, "D", 30, 5, 2, 1, formula = ~ x1 + x2 + x1:x2, #' coef = c(0, -4.086, -1.476, 0.01)) #' #' alteval.ic(facDes, "U", 30, 5, 2, 1, formula = ~ x1 + x2 + x1:x2, #' coef = c(0, -4.086, -1.476, 0.01), useCond = c(1.758, 3.159)) #' #' alteval.ic(facDes, "I", 30, 5, 2, 1, formula = ~ x1 + x2 + x1:x2, #' coef = c(0, -4.086, -1.476, 0.01), useLower = c(1.458, 2.859), useUpper = c(2.058, 3.459)) #' @export alteval.ic <- function(designTable, optType, t, k, nf, alpha, formula, coef, useCond, useLower, useUpper) { # Transform design to the single column array. x <- NULL for (col in (1:nf)) { for (row in (1:nrow(designTable))) { x <- c(x, rep(designTable[row, col], designTable[row, nf + 1])) } } if (optType == "D") value <- Dobj.ic(x, formula, coef, nf, t, k, alpha) else if (optType == "U") value <- Uobj.ic(x, formula, coef, nf, t, k, alpha, useCond) else if (optType == "I") value <- Iobj.ic(x, formula, coef, nf, t, k, alpha, useLower, useUpper) else stop('Wrong optimization criteria') value } #' Optimal design with interval censoring. #' #' \code{\link{altopt.ic}} creates D, U or I optimal design #' of the accelerated life testing with interval censoring plan. #' #' @param optType the choice of \code{"D"}, \code{"U"} and \code{"I"} optimality. #' @param N the number of test units. #' @param t the total testing time. #' @param k the number of time intervals. #' @param nf the number of stress factors. #' @param alpha the value of the shape parameter of Weibull distribution. #' @param formula the object of class formula which is the linear predictor model. #' @param coef the numeric vector containing the coefficients of each term in \code{formula}. #' @param useCond the numeric vector of use condition. #' It should be provided when \code{optType} is \code{"U"}. The length of the vector #' should be same as the number of stress factors. #' @param useLower the numeric vector of lower bound of use region. #' It should be provided when \code{optType} is \code{"I"}. The length of the vector #' should be same as the number of stress factors. #' @param useUpper the numeric vector of upper bound of use region. #' It should be provided when \code{optType} is \code{"I"}. The length of the vector #' should be same as the number of stress factors. #' @param nOpt the number of repetition of optimization process. Default is 1. #' @param nKM the number of repetition of k-means clustering. Default is 20. #' @param nCls the number of clusters used for k-means clustering. If not specified, #' it is set as the number of parameters in the linear predictor model. #' @return A list with components #' \itemize{ #' \item{call:}{ the matched call.} #' \item{opt.design.ori:}{ the original optimal design.} #' \item{opt.value.ori:}{ the objective function value of \code{opt.design.ori}.} #' \item{opt.design.rounded:}{ the optimal design clustered by rounding in third decimal points.} #' \item{opt.value.rounded:}{ the objective function value of \code{opt.design.rounded}.} #' \item{opt.design.kmeans:}{ the optimal design clustered by \code{\link[stats]{kmeans}}.} #' \item{opt.value.kmeans:}{ the objective function value of \code{opt.design.kmeans}.} #' } #' @references #' { #' Monroe, E. M., Pan, R., Anderson-Cook, C. M., Montgomery, D. C. and #' Borror C. M. (2011) A Generalized Linear Model Approach to Designing #' Accelerated Life Test Experiments, \emph{Quality and Reliability Engineering #' International} \bold{27(4)}, 595--607 #' #' Yang, T., Pan, R. (2013) A Novel Approach to Optimal Accelerated Life Test #' Planning With Interval Censoring, \emph{Reliability, IEEE Transactions on} #' \bold{62(2)}, 527--536 #' } #' @seealso \code{\link[stats]{kmeans}}, \code{\link{alteval.ic}} #' @examples #' \dontrun{ #' # Generating D optimal design for interval censoring. #' altopt.ic("D", 100, 30, 5, 2, 1, formula = ~ x1 + x2 + x1:x2, #' coef = c(0, -4.086, -1.476, 0.01)) #' #' # Generating U optimal design for interval censoring. #' altopt.ic("D", 100, 30, 5, 2, 1, formula = ~ x1 + x2 + x1:x2, #' coef = c(0, -4.086, -1.476, 0.01), useCond = c(1.758, 3.159)) #' #' # Generating I optimal design for interval censoring. #' altopt.ic("D", 100, 30, 5, 2, 1, formula = ~ x1 + x2 + x1:x2, #' coef = c(0, -4.086, -1.476, 0.01), useLower = c(1.458, 2.859), #' useUpper = c(2.058, 3.459)) #' } #' @importFrom stats aggregate #' @importFrom stats optim #' @importFrom stats runif #' @importFrom methods is #' @export altopt.ic <- function(optType, N, t, k, nf, alpha, formula, coef, useCond, useLower, useUpper, nOpt = 1, nKM = 30, nCls = NULL) { # function for optimization Opt.ic <- function() { xInit <- runif(nf * N, min = 0, max = 1) lb <- rep(0, nf * N) ub <- rep(1, nf * N) if (optType == "D") solution <- optim(xInit, Dobj.ic, NULL, formula, coef, nf, t, k, alpha, method = "L-BFGS-B", lower = lb, upper = ub, control = list(fnscale = -1) # Maximization ) else if (optType == "U") solution <- optim(xInit, Uobj.ic, NULL, formula, coef, nf, t, k, alpha, useCond, method = "L-BFGS-B", lower = lb, upper = ub) else if (optType == "I") solution <- optim(xInit, Iobj.ic, NULL, formula, coef, nf, t, k, alpha, useLower, useUpper, method = "L-BFGS-B", lower = lb, upper = ub) else stop('Wrong optimization criteria') solution } # Repeat optimization with different initial points for (i in 1:nOpt) { Curr_sol <- Opt.ic() if (i == 1) Best_sol <- Curr_sol else if (optType == "D" && Curr_sol$value > Best_sol$value) Best_sol <- Curr_sol else if ((optType %in% c("U", "I")) && Curr_sol$value < Best_sol$value) Best_sol <- Curr_sol } terms <- attr(terms(formula), "term.labels") optDesignMtx <- as.data.frame(matrix(Best_sol$par, ncol = nf)) colnames(optDesignMtx) <- terms[1:nf] # Original result columnlist <- apply(optDesignMtx, 2, list) columnlist <- lapply(columnlist, unlist) optDesignOri <- aggregate(optDesignMtx, columnlist, length) while (length(optDesignOri) != (nf + 1)) optDesignOri <- optDesignOri[, -length(optDesignOri)] names(optDesignOri)[ncol(optDesignOri)] <- paste("allocation") optValueOri <- alteval.ic(optDesignOri, optType, t, k, nf, alpha, formula, coef, useCond, useLower, useUpper) # Rounding result optDesignMtxRound <- round(optDesignMtx, digits = 3) columnlist <- apply(optDesignMtxRound, 2, list) columnlist <- lapply(columnlist, unlist) optDesignRound <- aggregate(optDesignMtxRound, columnlist, length) while (length(optDesignRound) != (nf + 1)) optDesignRound <- optDesignRound[, -length(optDesignRound)] names(optDesignRound)[ncol(optDesignRound)] <- paste("allocation") optValueRound <- alteval.ic(optDesignRound, optType, t, k, nf, alpha, formula, coef, useCond, useLower, useUpper) # k-means result if (is.null(nCls)) nCls <- length(coef) for (j in 1:nKM) { curDesignKmeans <- kmeansCls(optDesignMtx, nCls) curValueKmeans <- alteval.ic(curDesignKmeans, optType, t, k, nf, alpha, formula, coef, useCond, useLower, useUpper) if (j == 1) { optDesignKmeans <- curDesignKmeans optValueKmeans <- curValueKmeans } else if (optType == "D" && curValueKmeans > optValueKmeans) { optDesignKmeans <- curDesignKmeans optValueKmeans <- curValueKmeans } else if ((optType %in% c("U", "I")) && curValueKmeans < optValueKmeans) { optDesignKmeans <- curDesignKmeans optValueKmeans <- curValueKmeans } } # Creates output out <- list(call = match.call(), opt.design.ori = optDesignOri, opt.value.ori = as.numeric(optValueOri), opt.design.rounded = optDesignRound, opt.value.rounded = as.numeric(optValueRound), opt.design.kmeans = optDesignKmeans, opt.value.kmeans = ifelse (is(optValueKmeans, "character"), optValueKmeans, as.numeric(optValueKmeans)) ) out } #' Design plot. #' #' \code{\link{design.plot}} draws design plot as a form of a bubble plot #' of any two stress factors which are specified by \code{xAxis} and \code{yAxis}. #' The size of each bubble indicates the relative magnitude of allocation on #' each design point. #' #' @param design the data frame containing the coordinates and the number of #' allocation of each design point. The design created by either #' \code{\link{altopt.rc}} or \code{\link{altopt.ic}} or any design matrix #' with the same form as those can be provided for this argument. #' @param xAxis the name of the factor to be displayed in x axis. #' @param yAxis the name of the factor to be displayed in y axis. #' @return The bubble plot of a design with two stress factors. #' @examples #' \dontrun{ #' # Design plot of D optimal design with right censoring. #' Design1 <- altopt.rc("D", 100, 100, 2, 1, formula = ~ x1 + x2 + x1:x2, #' coef = c(0, -4.086, -1.476, 0.01)) #' #' design.plot(Design1$opt.design.rounded, x1, x2) #' } #' @importFrom graphics plot #' @importFrom graphics rect #' @importFrom graphics symbols #' @importFrom graphics text #' @importFrom stats aggregate #' @export design.plot <- function (design, xAxis, yAxis) { designName <- deparse(substitute(design)) xAxisName <- deparse(substitute(xAxis)) yAxisName <- deparse(substitute(yAxis)) plot(1, type = "n", main = designName, xlab = xAxisName, ylab = yAxisName, xaxp = c(0, 1, 5), yaxp = c(0, 1, 5), xlim = c(-0.2, 1.2), ylim = c(-0.2, 1.2), frame = FALSE) rect(0, 0, 1, 1) agg.des <- aggregate(design, by = list(design[, colnames(design) == xAxisName], design[, colnames(design) == yAxisName]), FUN = sum) symbols(agg.des$Group.1, agg.des$Group.2, circles = agg.des$allocation / 300, inches = FALSE, add = TRUE, fg = "blue", bg = "white", lwd = 1.5) text(agg.des$Group.1, agg.des$Group.2, agg.des$allocation, cex = .75) } #' Contour plot of prediction variance for a design with right censoring. #' #' \code{\link{pv.contour.rc}} draws the contour plot of prediction variance #' for a given design with right censoring plan. Either \code{useCond} or #' use region (\code{useLower} and \code{useUpper}) should be #' provided. #' #' @param design the data frame containing the coordinates and the number of #' allocation of each design point. The design created by either #' \code{\link{altopt.rc}} or \code{\link{altopt.ic}} or any design matrix #' with the same form as those can be provided for this argument. #' @param xAxis the name of the factor to be displayed in x axis. #' @param yAxis the name of the factor to be displayed in y axis. #' @param tc the censoring time. #' @param nf the number of stress factors. #' @param alpha the value of the shape parameter of Weibull distribution. #' @param formula the object of class formula which is the linear predictor model. #' @param coef the numeric vector containing the coefficients of each term in \code{formula}. #' @param useCond the vector of specified use condition. If it is provided, #' the contour line will be generated up to this point. #' @param useLower,useUpper the vector of the use region. If these are #' provided, the contour line will be generated up to this region. #' Note that either \code{useCond} or both of \code{useLower, useUpper} #' should be provided. #' @return The contour plot of prediction variance for right censoring. #' @seealso \code{\link{altopt.rc}} #' @examples #' \dontrun{ #' # Contour plot of prediction variance of U optimal design with right censoring. #' Design <- altopt.rc("D", 100, 100, 2, 1, formula = ~ x1 + x2 + x1:x2, #' coef = c(0, -4.086, -1.476, 0.01), useCond = c(1.758, 3.159)) #' #' pv.contour.rc(Design$opt.design.rounded, x1, x2, 100, 2, 1, #' formula = ~ x1 + x2 + x1:x2, coef = c(0, -4.086, -1.476, 0.01), useCond = c(1.758, 3.159)) #' } #' @importFrom graphics contour #' @importFrom graphics points #' @importFrom graphics rect #' @importFrom graphics segments #' @importFrom graphics symbols #' @importFrom graphics text #' @importFrom graphics title #' @importFrom stats aggregate #' @export pv.contour.rc <- function (design, xAxis, yAxis, tc, nf, alpha, formula, coef, useCond = NULL, useLower = NULL, useUpper = NULL) { designName <- deparse(substitute(design)) xAxisName <- deparse(substitute(xAxis)) yAxisName <- deparse(substitute(yAxis)) xColNum <- which(colnames(design) == xAxisName) yColNum <- which(colnames(design) == yAxisName) pv <- function (useCond, ux, uy) { useCond[xColNum] <- ux # change use condition of two factors given by user useCond[yColNum] <- uy # with maintaining values of the other factors as.numeric(alteval.rc(design, optType = "U", tc, nf, alpha, formula, coef, useCond)) } if (!is.null(useCond)) { range <- ceiling(max(useCond[xColNum], useCond[yColNum])) pv.use <- round(pv(useCond, useCond[xColNum], useCond[yColNum]), digits = 2) } else if (!is.null(useLower) && !is.null(useUpper)) { range <- ceiling(max(useUpper[xColNum], useUpper[yColNum])) pv.use <- round(pv(useUpper, useUpper[xColNum], useUpper[yColNum]), digits = 2) } else stop('Use condition missing, either useCond or both of useLower and useUpper should be provided.') x <- seq(0, range, 0.1) y <- seq(0, range, 0.1) pv.grid <- matrix(nrow = length(x), ncol = length(y)) for (r in 1:length(x)) { for (c in 1:length(y)) { if (!is.null(useCond)) pv.grid[r, c] <- pv(useCond, x[r], y[c]) else if (!is.null(useLower) && !is.null(useUpper)) pv.grid[r, c] <- pv((useLower + useUpper) / 2, x[r], y[c]) } } mylevels <- seq(0, pv.use, 0.1) contour(x, y, pv.grid, levels = mylevels, method = "edge", pty = "s") title(main = paste("PV contour of ", designName, sep = ""), xlab = xAxisName, ylab = yAxisName, cex.main = .75) agg.des <- aggregate(design, by = list(design[, colnames(design) == xAxisName], design[, colnames(design) == yAxisName]), FUN = sum) symbols(agg.des$Group.1, agg.des$Group.2, circles = agg.des$allocation / 300, inches = FALSE, add = TRUE, bg = "gray") text(agg.des$Group.1, agg.des$Group.2, agg.des$allocation, cex = .75, adj = c(-.5, 1)) segments(0, 0, range, 0) segments(0, 0, 0, range) segments(range, 0, range, range) segments(0, range, range, range) segments(0, 1, 1, 1) segments(1, 0, 1, 1) if (!is.null(useCond)) { points(useCond[xColNum], useCond[yColNum], pch=22, bg="white") text(useCond[xColNum], useCond[yColNum], paste("PV =", pv.use), cex = .75, adj = c(-.2, -.2)) segments(0, useCond[yColNum], useCond[xColNum], useCond[yColNum]) segments(useCond[xColNum], 0, useCond[xColNum], useCond[yColNum]) } else if (!is.null(useLower) && !is.null(useUpper)) { rect(useLower[xColNum], useLower[yColNum], useUpper[xColNum], useUpper[yColNum], col="white") text((useLower[xColNum] + useUpper[xColNum]) / 2, (useLower[yColNum] + useUpper[yColNum]) / 2, "Use Region", cex = .5, adj = c(0.5, 0.5)) } } #' Contour plot of prediction variance for a design with interval censoring. #' #' \code{\link{pv.contour.ic}} draws the contour plot of prediction variance #' for a given design with interval censoring plan. Either \code{useCond} or #' use region (\code{useLower} and \code{useUpper}) should be #' provided. #' #' @param design the data frame containing the coordinates and the number of #' allocation of each design point. The design created by either #' \code{\link{altopt.rc}} or \code{\link{altopt.ic}} or any design matrix #' with the same form as those can be provided for this argument. #' @param xAxis the name of the factor to be displayed in x axis. #' @param yAxis the name of the factor to be displayed in y axis. #' @param t the total testing time. #' @param k the number of time intervals. #' @param nf the number of stress factors. #' @param alpha the value of the shape parameter of Weibull distribution. #' @param formula the object of class formula which is the linear predictor model. #' @param coef the numeric vector containing the coefficients of each term in \code{formula}. #' @param useCond the vector of specified use condition. If it is provided, #' the contour line will be generated up to this point. #' @param useLower,useUpper the vector of the use region. If these are #' provided, the contour line will be generated up to this region. #' Note that either \code{useCond} or both of \code{useLower, useUpper} #' should be provided. #' @return The contour plot of prediction variance for interval censoring. #' @seealso \code{\link{altopt.ic}} #' @examples #' \dontrun{ #' # Contour plot of prediction variance of U optimal design with interval censoring. #' Design <- altopt.ic("D", 100, 30, 5, 2, 1, formula = ~ x1 + x2 + x1:x2, #' coef = c(0, -4.086, -1.476, 0.01), useCond = c(1.758, 3.159)) #' #' pv.contour.ic(Design$opt.design.rounded, x1, x2, 30, 5, 2, 1, #' formula = ~ x1 + x2 + x1:x2, coef = c(0, -4.086, -1.476, 0.01), useCond = c(1.758, 3.159)) #' } #' @importFrom graphics contour #' @importFrom graphics points #' @importFrom graphics rect #' @importFrom graphics segments #' @importFrom graphics symbols #' @importFrom graphics text #' @importFrom graphics title #' @importFrom stats aggregate #' @export pv.contour.ic <- function (design, xAxis, yAxis, t, k, nf, alpha, formula, coef, useCond = NULL, useLower = NULL, useUpper = NULL) { designName <- deparse(substitute(design)) xAxisName <- deparse(substitute(xAxis)) yAxisName <- deparse(substitute(yAxis)) xColNum <- which(colnames(design) == xAxisName) yColNum <- which(colnames(design) == yAxisName) pv <- function (useCond, ux, uy) { useCond[xColNum] <- ux # change use condition of two factors given by user useCond[yColNum] <- uy # with maintaining values of the other factors as.numeric(alteval.ic(design, optType = "U", t, k, nf, alpha, formula, coef, useCond)) } if (!is.null(useCond)) { range <- ceiling(max(useCond[xColNum], useCond[yColNum])) pv.use <- round(pv(useCond, useCond[xColNum], useCond[yColNum]), digits = 2) } else if (!is.null(useLower) && !is.null(useUpper)) { range <- ceiling(max(useUpper[xColNum], useUpper[yColNum])) pv.use <- round(pv(useUpper, useUpper[xColNum], useUpper[yColNum]), digits = 2) } else stop('Use condition missing, either useCond or both of useLower and useUpper should be provided.') x <- seq(0, range, 0.1) y <- seq(0, range, 0.1) pv.grid <- matrix(nrow = length(x), ncol = length(y)) for (r in 1:length(x)) { for (c in 1:length(y)) { if (!is.null(useCond)) pv.grid[r, c] <- pv(useCond, x[r], y[c]) else if (!is.null(useLower) && !is.null(useUpper)) pv.grid[r, c] <- pv((useLower + useUpper) / 2, x[r], y[c]) } } mylevels <- seq(0, pv.use, 0.1) contour(x, y, pv.grid, levels = mylevels, method = "edge", pty="s") title(main = paste("PV contour of ", designName, sep = ""), xlab = xAxisName, ylab = yAxisName, cex.main = .75) agg.des <- aggregate(design, by = list(design[, colnames(design) == xAxisName], design[, colnames(design) == yAxisName]), FUN = sum) symbols(agg.des$Group.1, agg.des$Group.2, circles = agg.des$allocation / 300, inches = FALSE, add = TRUE, bg = "gray") text(agg.des$Group.1, agg.des$Group.2, agg.des$allocation, cex = .75, adj = c(-.5, 1)) segments(0, 0, range, 0) segments(0, 0, 0, range) segments(range, 0, range, range) segments(0, range, range, range) segments(0, 1, 1, 1) segments(1, 0, 1, 1) if (!is.null(useCond)) { points(useCond[xColNum], useCond[yColNum], pch=22, bg="white") text(useCond[xColNum], useCond[yColNum], paste("PV =", pv.use), cex = .75, adj = c(-.2, -.2)) segments(0, useCond[yColNum], useCond[xColNum], useCond[yColNum]) segments(useCond[xColNum], 0, useCond[xColNum], useCond[yColNum]) } else if (!is.null(useLower) && !is.null(useUpper)) { rect(useLower[xColNum], useLower[yColNum], useUpper[xColNum], useUpper[yColNum], col="white") text((useLower[xColNum] + useUpper[xColNum]) / 2, (useLower[yColNum] + useUpper[yColNum]) / 2, "Use Region", cex = .5, adj = c(0.5, 0.5)) } } #' FUS (Fraction of Use Space) plot for right censoring. #' #' \code{\link{pv.fus.rc}} draws the FUS plot of prediction variance #' for a given design with right censoring plan. The use region #' (\code{useLower} and \code{useUpper}) should be #' provided. #' #' @param useLower,useUpper the vectors containing the lower bound and upper #' bound for the use region. They should be provided for FUS plot. #' @return The "trellis" object which includes the FUS plot #' for right censoring. #' @inheritParams design.plot #' @inheritParams altopt.rc #' @seealso \code{\link{altopt.rc}} #' @examples #' \dontrun{ #' # FUS plot of I optimal design with right censoring. #' Design <- altopt.rc("I", 100, 100, 2, 1, formula = ~ x1 + x2 + x1:x2, #' coef = c(0, -4.086, -1.476, 0.01), useLower = c(1.458, 2.859), useUpper = c(2.058, 3.459)) #' #' pv.fus.rc(Design$opt.design.rounded, 100, 2, 1, #' formula = ~ x1 + x2 + x1:x2, coef = c(0, -4.086, -1.476, 0.01), #' useLower = c(1.458, 2.859), useUpper = c(2.058, 3.459)) #' } #' @export pv.fus.rc <- function (design, tc, nf, alpha, formula, coef, useLower = NULL, useUpper = NULL) { if (is.null(useLower) || is.null(useUpper)) stop('Use condition missing') d <- round(5000 ^ (1 / nf)) pv.grid <- matrix(nrow = d ^ nf, ncol = nf + 1) for (p in 1:nf) { range <- seq(useLower[p], useUpper[p], length.out = d) pv.grid[, p] <- rep(rep(range, each = d ^ (nf - p)), d ^ (p - 1)) } for (r in 1:nrow(pv.grid)) { pv.grid[r, ncol(pv.grid)] <- as.numeric(alteval.rc(design, optType = "U", tc, nf, alpha, formula, coef, useCond = pv.grid[r, 1:nf])) } fus <- cbind(sort(pv.grid[, ncol(pv.grid)]), c(1:nrow(pv.grid)) / nrow(pv.grid)) plot <- lattice::xyplot(fus[, 1] ~ fus[, 2], aspect = 1 / 2, main = paste("FUS of ", deparse(substitute(design)), sep = ""), xlab = paste("Fraction of Use Space"), ylab = paste("Prediction Variance"), type = "a", grid = TRUE, scales = list(x = list(tick.number = 11))) plot } #' FUS (Fraction of Use Space) plot for interval censoring. #' #' \code{\link{pv.fus.ic}} draws the FUS plot of prediction variance #' for a given design with interval censoring plan. The use region #' (\code{useLower} and \code{useUpper}) should be #' provided. #' #' @param useLower,useUpper the vectors containing the lower bound and upper #' bound for the use region. They should be provided for FUS plot. #' @return The "trellis" object which includes the FUS plot #' for interval censoring. #' @inheritParams design.plot #' @inheritParams altopt.ic #' @seealso \code{\link{altopt.ic}} #' @examples #' \dontrun{ #' # FUS plot of I optimal design with interval censoring. #' Design <- altopt.ic("I", 100, 30, 5, 2, 1, formula = ~ x1 + x2 + x1:x2, #' coef = c(0, -4.086, -1.476, 0.01), useLower = c(1.458, 2.859), useUpper = c(2.058, 3.459)) #' #' pv.fus.ic(Design$opt.design.rounded, 30, 5, 2, 1, #' formula = ~ x1 + x2 + x1:x2, coef = c(0, -4.086, -1.476, 0.01), #' useLower = c(1.458, 2.859), useUpper = c(2.058, 3.459)) #' } #' @export pv.fus.ic <- function (design, t, k, nf, alpha, formula, coef, useLower = NULL, useUpper = NULL) { if (is.null(useLower) || is.null(useUpper)) stop('Use condition missing') d <- round(5000 ^ (1 / nf)) pv.grid <- matrix(nrow = d ^ nf, ncol = nf + 1) for (p in 1:nf) { range <- seq(useLower[p], useUpper[p], length.out = d) pv.grid[, p] <- rep(rep(range, each = d ^ (nf - p)), d ^ (p - 1)) } for (r in 1:nrow(pv.grid)) { pv.grid[r, ncol(pv.grid)] <- as.numeric(alteval.ic(design, optType="U", t, k, nf, alpha, formula, coef, useCond = pv.grid[r, 1:nf])) } fus <- cbind(sort(pv.grid[, ncol(pv.grid)]), c(1:nrow(pv.grid)) / nrow(pv.grid)) plot <- lattice::xyplot(fus[, 1] ~ fus[, 2], aspect = 1 / 2, main = paste("FUS of ", deparse(substitute(design)), sep = ""), xlab = paste("Fraction of Use Space"), ylab = paste("Prediction Variance"), type = "a", grid = TRUE, scales = list(x = list(tick.number = 11))) plot } #' Comparing designs using FUS #' #' \code{\link{compare.fus}} draws the FUS plots of multiple designs on a #' single frame. #' #' @param ... Objects created by \code{\link{pv.fus.rc}} or #' \code{\link{pv.fus.ic}}. #' @return FUS plots of multiple designs. #' @seealso \code{\link{pv.fus.rc}}, \code{\link{pv.fus.ic}} #' @examples #' \dontrun{ #' # Generating D optimal design and FUS plot. #' Dopt <- altopt.rc("D", 100, 100, 2, 1, formula = ~ x1 + x2 + x1:x2, #' coef = c(0, -4.086, -1.476, 0.01)) #' #' FUS.D <- pv.fus.rc(Dopt$opt.design.rounded, 100, 2, 1, #' formula = ~ x1 + x2 + x1:x2, coef = c(0, -4.086, -1.476, 0.01), #' useLower = c(1.458, 2.859), useUpper = c(2.058, 3.459)) #' #' # Generating U optimal design and FUS plot. #' Uopt <- altopt.rc("U", 100, 100, 2, 1, formula = ~ x1 + x2 + x1:x2, #' coef = c(0, -4.086, -1.476, 0.01), useCond = c(1.758, 3.159)) #' #' FUS.U <- pv.fus.rc(Uopt$opt.design.rounded, 100, 2, 1, #' formula = ~ x1 + x2 + x1:x2, coef = c(0, -4.086, -1.476, 0.01), #' useLower = c(1.458, 2.859), useUpper = c(2.058, 3.459)) #' #' # Comparing D and U optimal designs. #' compare.fus(FUS.D, FUS.U) #' } #' @export compare.fus <- function (...) { # Keep the name of arguments as string nm <- unlist(strsplit(deparse(substitute(list(...))), split = ",")) nm <- unlist(strsplit(nm, split = " ")) nm <- unlist(strsplit(nm, split = "list(", fixed = TRUE)) nm <- unlist(strsplit(nm, split = ")", fixed = TRUE)) fus.obj <- list(...) data <- data.frame() for (i in 1:length(fus.obj)) { data <- rbind(data, data.frame(y = fus.obj[[i]]$panel.args[[1]]$y, x = fus.obj[[i]]$panel.args[[1]]$x, z = nm[i])) } plot <- lattice::xyplot(y ~ x, data, groups = data$z, auto.key = list(corner = c(0, 1)), aspect = 1 / 2, main = paste("FUS of ", deparse(substitute(list(...))), sep = ""), xlab = paste("Fraction of Use Space"), ylab = paste("Prediction Variance"), type = "a", grid = TRUE, scales = list(x = list(tick.number = 11))) plot } #' VDUS (Variance Dispersion of Use Space) plot for right censoring. #' #' \code{\link{pv.vdus.rc}} draws the VDUS plot of prediction variance #' for a given design with right censoring plan. The use region #' (\code{useLower} and \code{useUpper}) should be #' provided. #' #' @param useLower,useUpper the vectors containing the lower bound and upper #' bound for the use region. They should be provided for VDUS plot. #' @return The "trellis" object which includes the VDUS plot #' for right censoring. #' @inheritParams design.plot #' @inheritParams altopt.rc #' @seealso \code{\link{altopt.rc}} #' @examples #' \dontrun{ #' # VDUS plot of I optimal design with right censoring. #' Design <- altopt.rc("I", 100, 100, 2, 1, formula = ~ x1 + x2 + x1:x2, #' coef = c(0, -4.086, -1.476, 0.01), useLower = c(1.458, 2.859), useUpper = c(2.058, 3.459)) #' #' pv.vdus.rc(Design$opt.design.rounded, 100, 2, 1, #' formula = ~ x1 + x2 + x1:x2, coef = c(0, -4.086, -1.476, 0.01), #' useLower = c(1.458, 2.859), useUpper = c(2.058, 3.459)) #' } #' @importFrom stats aggregate #' @export pv.vdus.rc <- function (design, tc, nf, alpha, formula, coef, useLower = NULL, useUpper = NULL) { if (is.null(useLower) || is.null(useUpper)) stop('Use condition missing') d <- round(5000 ^ (1 / nf)) if (d %% 2 == 0) d <- d + 1 pv.grid <- matrix(nrow = d ^ nf, ncol = nf) for (p in 1:nf) { range <- seq(useLower[p], useUpper[p], length.out = d) pv.grid[, p] <- rep(rep(range, each = d ^ (nf - p)), d ^ (p - 1)) } center <- (useLower + useUpper) / 2 dx <- (useUpper - center) / ((d - 1) / 2) rank <- numeric(length = nrow(pv.grid)) for (r in 1:nrow(pv.grid)) { if (all(pv.grid[r, ] == center)) rank[r] <- 0 else { for (n in 1:(d - 1) / 2) { for (p in 1:nf) { if ((round(pv.grid[r, p], 3) == round(center[p] + n * dx[p], 3) || round(pv.grid[r, p], 3) == round(center[p] - n * dx[p], 3)) && round(pv.grid[r, -p], 3) >= round(center[-p] - n * dx[-p], 3) && round(pv.grid[r, -p], 3) <= round(center[-p] + n * dx[-p], 3)) rank[r] <- n } } } } pv.grid <- cbind(pv.grid, rank) pv <- numeric(length = nrow(pv.grid)) for (r in 1:nrow(pv.grid)) { pv[r] <- as.numeric(alteval.rc(design, optType = "U", tc, nf, alpha, formula, coef, useCond = pv.grid[r, 1:nf])) } pv.grid <- cbind(pv.grid, pv) min <- aggregate(pv.grid, by = list(pv.grid[, "rank"]), FUN = min) avg <- aggregate(pv.grid, by = list(pv.grid[, "rank"]), FUN = mean) max <- aggregate(pv.grid, by = list(pv.grid[, "rank"]), FUN = max) vdus <- rbind(cbind(min, gr = "min"), cbind(avg, gr = "avg"), cbind(max, gr = "max")) plot <- lattice::xyplot(vdus$pv ~ vdus$rank, aspect = 1 / 2, main = paste("VDUS of ", deparse(substitute(design)), sep = ""), xlab = paste("Relative radius from origin"), ylab = paste("Prediction Variance"), type = "smooth", grid = TRUE, group = vdus$gr, auto.key = list(corner = c(0, 1))) plot } #' VDUS (Variance Dispersion of Use Space) plot for interval censoring. #' #' \code{\link{pv.vdus.ic}} draws the VDUS plot of prediction variance #' for a given design with interval censoring plan. The use region #' (\code{useLower} and \code{useUpper}) should be #' provided. #' #' @param useLower,useUpper the vectors containing the lower bound and upper #' bound for the use region. They should be provided for VDUS plot. #' @return The "trellis" object which includes the VDUS plot #' for interval censoring. #' @inheritParams design.plot #' @inheritParams altopt.ic #' @seealso \code{\link{altopt.ic}} #' @examples #' \dontrun{ #' # VDUS plot of I optimal design with interval censoring. #' Design <- altopt.ic("I", 100, 30, 5, 2, 1, formula = ~ x1 + x2 + x1:x2, #' coef = c(0, -4.086, -1.476, 0.01), useLower = c(1.458, 2.859), useUpper = c(2.058, 3.459)) #' #' pv.vdus.ic(Design$opt.design.rounded, 30, 5, 2, 1, #' formula = ~ x1 + x2 + x1:x2, coef = c(0, -4.086, -1.476, 0.01), #' useLower = c(1.458, 2.859), useUpper = c(2.058, 3.459)) #' } #' @importFrom stats aggregate #' @export pv.vdus.ic <- function (design, t, k, nf, alpha, formula, coef, useLower = NULL, useUpper = NULL) { if (is.null(useLower) || is.null(useUpper)) stop('Use condition missing') d <- round(5000 ^ (1 / nf)) if (d %% 2 == 0) d <- d + 1 pv.grid <- matrix(nrow = d ^ nf, ncol = nf) for (p in 1:nf) { range <- seq(useLower[p], useUpper[p], length.out = d) pv.grid[, p] <- rep(rep(range, each = d ^ (nf - p)), d ^ (p - 1)) } center <- (useLower + useUpper) / 2 dx <- (useUpper - center)/((d - 1) / 2) rank <- numeric(length = nrow(pv.grid)) for (r in 1:nrow(pv.grid)) { if (all(pv.grid[r, ] == center)) rank[r] <- 0 else { for (n in 1:(d - 1) / 2) { for (p in 1:nf) { if ((round(pv.grid[r, p], 3) == round(center[p] + n * dx[p], 3) || round(pv.grid[r, p], 3) == round(center[p] - n * dx[p], 3)) && round(pv.grid[r, -p], 3) >= round(center[-p] - n * dx[-p], 3) && round(pv.grid[r, -p], 3) <= round(center[-p] + n * dx[-p], 3)) rank[r] <- n } } } } pv.grid <- cbind(pv.grid, rank) pv <- numeric(length = nrow(pv.grid)) for (r in 1:nrow(pv.grid)) { pv[r] <- as.numeric(alteval.ic(design, optType = "U", t, k, nf, alpha, formula, coef, useCond = pv.grid[r, 1:nf])) } pv.grid <- cbind(pv.grid, pv) min <- aggregate(pv.grid, by = list(pv.grid[, "rank"]), FUN = min) avg <- aggregate(pv.grid, by = list(pv.grid[, "rank"]), FUN = mean) max <- aggregate(pv.grid, by = list(pv.grid[, "rank"]), FUN = max) vdus <- rbind(cbind(min, gr = "min"), cbind(avg, gr = "avg"), cbind(max, gr = "max")) plot <- lattice::xyplot(vdus$pv ~ vdus$rank, aspect = 1 / 2, main = paste("VDUS of ", deparse(substitute(design)), sep = ""), xlab = paste("Relative radius from origin"), ylab = paste("Prediction Variance"), type = "smooth", grid = TRUE, group = vdus$gr, auto.key = list(corner = c(0, 1))) plot } #' Comparing designs using VDUS #' #' \code{\link{compare.vdus}} draws the VDUS plots of multiple designs on a #' single frame. #' #' @param ... Objects created by \code{\link{pv.vdus.rc}} or #' \code{\link{pv.vdus.ic}}. #' @return VDUS plots of multiple designs. #' @seealso \code{\link{pv.vdus.rc}}, \code{\link{pv.vdus.ic}} #' @examples #' \dontrun{ #' # Generating D optimal design and VDUS plot. #' Dopt <- altopt.rc("D", 100, 100, 2, 1, formula = ~ x1 + x2 + x1:x2, #' coef = c(0, -4.086, -1.476, 0.01)) #' #' VDUS.D <- pv.vdus.rc(Dopt$opt.design.rounded, 100, 2, 1, #' formula = ~ x1 + x2 + x1:x2, coef = c(0, -4.086, -1.476, 0.01), #' useLower = c(1.458, 2.859), useUpper = c(2.058, 3.459)) #' #' # Generating U optimal design and VDUS plot. #' Uopt <- altopt.rc("U", 100, 100, 2, 1, formula = ~ x1 + x2 + x1:x2, #' coef = c(0, -4.086, -1.476, 0.01), useCond = c(1.758, 3.159)) #' #' VDUS.U <- pv.vdus.rc(Uopt$opt.design.rounded, 100, 2, 1, #' formula = ~ x1 + x2 + x1:x2, coef = c(0, -4.086, -1.476, 0.01), #' useLower = c(1.458, 2.859), useUpper = c(2.058, 3.459)) #' #' # Comparing D and U optimal designs. #' compare.vdus(VDUS.D, VDUS.U) #' } #' @export compare.vdus <- function (...) { nm <- unlist(strsplit(deparse(substitute(list(...))), split = ",")) nm <- unlist(strsplit(nm, split = " ")) nm <- unlist(strsplit(nm, split = "list(", fixed = TRUE)) nm <- unlist(strsplit(nm, split = ")", fixed = TRUE)) vdus.obj <- list(...) data <- data.frame() for (i in 1:length(vdus.obj)) { data <- rbind(data, data.frame(y = vdus.obj[[i]]$panel.args[[1]]$y, x = vdus.obj[[i]]$panel.args[[1]]$x, z = paste(nm[i], vdus.obj[[i]]$panel.args.common$groups), sep = ".")) } plot <- lattice::xyplot(y ~ x, data, groups = data$z, auto.key = list(corner = c(0, 1)), aspect = 1 / 2, main = paste("VDUS of ", deparse(substitute(list(...))), sep = ""), xlab = paste("Variance Dispersion of Use Space"), ylab = paste("Prediction Variance"), type = "a", grid = TRUE, scales = list(x = list(tick.number = 11))) plot } #' Coding and decoding stress level #' #' Convert the stress levels from the actual levels to standardized levels, #' and vice versa. #' #' @param lowStLv a numeric vector containing the actual lowest stress level #' of each stress variable in design region. #' @param highStLv a numeric vector containing the actual highest stress level #' of each stress variable in design region. #' @param actual a data frame or numeric vector containing the design points #' in actual units. #' @param stand a data frame or numeric vector containing the design points #' in standardized units. #' @return When \code{actual} is provided, the function converts it to the #' standardized units and when \code{stand} is provided, the function converts #' it to the actual units. #' @examples #' \dontrun{ #' # Generating D optimal design in coded unit. #' Design <- altopt.rc(optType = "D", N = 100, tc = 100, nf = 2, alpha = 1, #' formula = ~x1 + x2 + x1:x2, coef = c(0, -4.086, -1.476, 0.01)) #' #' # Transform the coded unit to actual stress variable's level. #' convert.stress.level(lowStLv = c(34.834, 4.094), highStLv = c(30.288, 4.5), #' stand = Design$opt.design.rounded) #' #' # Transform the actual stress level to coded units. #' use <- c(38.281, 3.219) #' convert.stress.level(lowStLv = c(34.834, 4.094), highStLv = c(30.288, 4.5), #' actual = use) #' } #' @importFrom methods is #' @export convert.stress.level <- function(lowStLv, highStLv, actual = NULL, stand = NULL) { nf <- length(lowStLv) if (is.null(actual) && is.null(stand)) stop ('Either actual or Stand should be provided.') else if (!is.null(actual) && !is.null(stand)) stop ('Only one of actual or Stand should be provided') else if (!is.null(stand)) { # Convert from stand to actual if (is(stand, "numeric")) stand <- as.data.frame(matrix(stand, ncol = nf)) out <- stand for (c in 1:nf) { for (r in 1:nrow(stand)) out[r, c] <- stand[r, c] * (lowStLv[c] - highStLv[c]) + highStLv[c] } } else if (!is.null(actual)) { # Convert from actual to stand if (is(actual, "numeric")) actual <- as.data.frame(matrix(actual, ncol = nf)) out <- actual for (c in 1:nf) { for (r in 1:nrow(actual)) out[r, c] <- (actual[r, c] - highStLv[c]) / (lowStLv[c] - highStLv[c]) } } out }
/scratch/gouwar.j/cran-all/cranData/ALTopt/R/ALTopt.R
#' Alfalfa soil requirement for land evaluation #' #' A dataset containing the soil characteristics of the crop requirements for farming Alfalfa. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item SoilTe - 12 classes of soil texture (Soil Taxonomy) #' \item CFragm - Coarse fragment (Vol.\%) #' \item SoilDpt - Soil depth (cm) #' \item CaCO3 - CaCO3 (\%) #' \item Gyps - Gypsum (\%) #' \item CECc - Apparent CEC Clay (cmol (+)/kg clay) #' \item BS - Base Saturation (\%) #' \item SumBCs - Sum of basic caions (cmol (+)/kg soil) #' \item pHH2O - pH H2O #' \item OC - Organic carbon (\%) #' \item ECedS - ECe (dS/m) #' \item ESP - ESP (\%) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 12 rows and 8 columns #' @name ALFALFASoil NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/ALFALFASoil.R
#' Alfalfa temp requirement for land evaluation #' #' A dataset containing the temp characteristics of the crop requirements for farming Alfalfa. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item TgAv - Mean temperature of the growing cycle (°C) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 1 rows and 8 columns #' @name ALFALFATemp NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/ALFALFATemp.R
#' Alfalfa terrain requirement for land evaluation #' #' A dataset containing the terrain characteristics of the crop requirements for farming Alfalfa. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item Slope1 - Slope (\%) (1. Irrigrated agriculture, basin furrow irrigation) #' \item Slope2 - Slope (\%) (2. High level of managemnet with full mechanization. ) #' \item Slope3 - Slope (\%) (3. Low level of managemnet animal traction or handwork.) #' \item Flood - Flooding #' \item Drainage4 - Drainage (Medium and fine textured soils) #' \item Drainage5 - Drainage (Coarse textured soils - Sandy families) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 6 rows and 8 columns #' @name ALFALFATerrain NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/ALFALFATerrain.R
#' Alfalfa water requirement for land evaluation #' #' A dataset containing the water characteristics of the crop requirements for farming Alfalfa. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item CropLen - Length of growing period (days) #' \item WgAv - Precipitation of growing cycle (mm) #' \item WghAv - Relative humidity growing cycle (\%) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 3 rows and 8 columns #' @name ALFALFAWater NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/ALFALFAWater.R
#' Agricultural Land Use Evaluation System #' #' Agricultural Land Use Evaluation System (ALUES) is #' a package that evaluates land suitability for #' different crop production. The package is based on #' the Food and Agriculture Organization (FAO) and the #' International Rice Research Institute (IRRI) methodology #' for land evaluation. Development of ALUES is inspired by #' similar tool for land evaluation, Land Use Suitability #' Evaluation Tool (LUSET). The package uses fuzzy logic #' approach to evaluate land suitability of a particular #' area based on inputs such as rainfall, #' temperature, topography, and soil properties. The #' membership functions used for fuzzy modeling are the #' following: Triangular, Trapezoidal, Gaussian, Sigmoidal #' and custom models with functions that can be #' defined by the user. The package also aims on complicated #' methods like considering more than one fuzzy membership #' function on different suitability class. The methods for #' computing the overall suitability of a particular area are #' also included, and these are the Minimum, Maximum, Product, #' Sum, Average, Exponential and Gamma. Finally, ALUES utilizes #' the power of Rcpp library for efficient computation. #' #' @author Al-Ahmadgaid B. Asaad <alahmadgaid@@gmail.com> (maintainer) #' @author Arnold R. Salvacion <arsalvacion@@gmail.com> #' @author Bui Tan Yen #' #' @import Rcpp #' @docType package #' @useDynLib ALUES #' @name ALUES-package NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/ALUES.R
#' Avocado soil requirement for land evaluation #' #' A dataset containing the soil characteristics of the crop requirements for farming Avocado. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item CFragm - Coarse fragment (Vol.\%) #' \item SoilDpt - Soil depth (cm) #' \item CaCO3 - CaCO3 (\%) #' \item CECc - Apparent CEC Clay (cmol (+)/kg clay) #' \item BS - Base Saturation (\%) #' \item SumBCs - Sum of basic caions (cmol (+)/kg soil) #' \item pHH2O - pH H2O #' \item OC - Organic carbon (\%) #' \item ECedS - ECe (dS/m) #' \item ESP - ESP (\%) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 10 rows and 8 columns #' @name AVOCADOSoil NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/AVOCADOSoil.R
#' Avocado temp requirement for land evaluation #' #' A dataset containing the temp characteristics of the crop requirements for farming Avocado. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item TgAv - Mean temperature of the growing cycle (°C) #' \item TmMinXm - Avarage minimum temperature of coldest month ( C ) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 2 rows and 8 columns #' @name AVOCADOTemp NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/AVOCADOTemp.R
#' Avocado terrain requirement for land evaluation #' #' A dataset containing the terrain characteristics of the crop requirements for farming Avocado. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item Slope1 - Slope (\%) (1. Irrigrated agriculture, basin furrow irrigation) #' \item Slope2 - Slope (\%) (2. High level of managemnet with full mechanization. ) #' \item Slope3 - Slope (\%) (3. Low level of managemnet animal traction or handwork.) #' \item Flood - Flooding #' \item Drainage - Drainage #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 5 rows and 8 columns #' @name AVOCADOTerrain NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/AVOCADOTerrain.R
#' Avocado water requirement for land evaluation #' #' A dataset containing the water characteristics of the crop requirements for farming Avocado. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item WyAv - Annual precipitation (mm) #' \item WmDryLen - Length dry season (months : P < 1/2 PET) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 2 rows and 8 columns #' @name AVOCADOWater NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/AVOCADOWater.R
#' Bamboo soil requirement for land evaluation #' #' A dataset containing the soil characteristics of the crop requirements for farming Bamboo. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item SoilDpt - Soil depth (cm) #' \item OC - Organic carbon (\%) #' \item SoilTe - 12 classes of soil texture (Soil Taxonomy) #' \item pHH2O - pH H2O #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 4 rows and 8 columns #' @name BAMBOOSoil NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/BAMBOOSoil.R
#' Bamboo temp requirement for land evaluation #' #' A dataset containing the temp characteristics of the crop requirements for farming Bamboo. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item TyAv - Mean annual temperature (°C) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 1 rows and 8 columns #' @name BAMBOOTemp NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/BAMBOOTemp.R
#' Bamboo terrain requirement for land evaluation #' #' A dataset containing the terrain characteristics of the crop requirements for farming Bamboo. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item SlopeD - Slope (degree, 6 classes) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 1 rows and 8 columns #' @name BAMBOOTerrain NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/BAMBOOTerrain.R
#' Bamboo water requirement for land evaluation #' #' A dataset containing the water characteristics of the crop requirements for farming Bamboo. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item WyAv - Annual precipitation (mm) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 1 rows and 8 columns #' @name BAMBOOWater NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/BAMBOOWater.R
#' Banana soil requirement for land evaluation #' #' A dataset containing the soil characteristics of the crop requirements for farming Banana. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item CFragm - Coarse fragment (Vol.\%) #' \item SoilDpt - Soil depth (cm) #' \item CaCO3 - CaCO3 (\%) #' \item Gyps - Gypsum (\%) #' \item CECc - Apparent CEC Clay (cmol (+)/kg clay) #' \item BS - Base Saturation (\%) #' \item SumBCs - Sum of basic caions (cmol (+)/kg soil) #' \item pHH2O - pH H2O #' \item OC - Organic carbon (\%) #' \item ECedS - ECe (dS/m) #' \item ESP - ESP (\%) #' \item SoilTe - 12 classes of soil texture (Soil Taxonomy) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 12 rows and 8 columns #' @name BANANASoil NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/BANANASoil.R
#' Banana temp requirement for land evaluation #' #' A dataset containing the temp characteristics of the crop requirements for farming Banana. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item TyMaxAv - Mean annual maximum temperature (°C) #' \item TmMinXm - Avarage minimum temperature of coldest month ( C ) #' \item TmMinXmAb - Absolute min temp. coldest month (°C) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 3 rows and 8 columns #' @name BANANATemp NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/BANANATemp.R
#' Banana terrain requirement for land evaluation #' #' A dataset containing the terrain characteristics of the crop requirements for farming Banana. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item Slope1 - Slope (\%) (1. Irrigrated agriculture, basin furrow irrigation) #' \item Slope2 - Slope (\%) (2. High level of managemnet with full mechanization. ) #' \item Slope3 - Slope (\%) (3. Low level of managemnet animal traction or handwork.) #' \item Flood - Flooding #' \item Drainage - Drainage #' \item SlopeD - Slope (degree, 6 classes) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 6 rows and 8 columns #' @name BANANATerrain NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/BANANATerrain.R
#' Banana water requirement for land evaluation #' #' A dataset containing the water characteristics of the crop requirements for farming Banana. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item WyAv - Annual precipitation (mm) #' \item WmDryLen - Length dry season (months : P < 1/2 PET) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 2 rows and 8 columns #' @name BANANAWater NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/BANANAWater.R
#' Barley soil requirement for land evaluation #' #' A dataset containing the soil characteristics of the crop requirements for farming Barley. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item CFragm - Coarse fragment (Vol.\%) #' \item SoilDpt - Soil depth (cm) #' \item CaCO3 - CaCO3 (\%) #' \item Gyps - Gypsum (\%) #' \item CECc - Apparent CEC Clay (cmol (+)/kg clay) #' \item BS - Base Saturation (\%) #' \item SumBCs - Sum of basic caions (cmol (+)/kg soil) #' \item pHH2O - pH H2O #' \item OC6 - Organic carbon (\%) - Kaolinitic materials #' \item OC7 - Organic carbon (\%) - Non Kaolinitic, Non calcareous materials #' \item OC8 - Organic carbon (\%) - Calcareous materials #' \item ECedS - ECe (dS/m) #' \item ESP - ESP (\%) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 13 rows and 8 columns #' @name BARLEYSoil NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/BARLEYSoil.R
#' Barley temp requirement for land evaluation #' #' A dataset containing the temp characteristics of the crop requirements for farming Barley. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item TmAv2 - Mean temp. crop development stage (2nd month) (°C) #' \item TmAv3 - Mean temp. of the flowering stage (°C) #' \item TmAv4 - Mean temp. of the ripening stage (°C) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 3 rows and 8 columns #' @name BARLEYTemp NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/BARLEYTemp.R
#' Barley terrain requirement for land evaluation #' #' A dataset containing the terrain characteristics of the crop requirements for farming Barley. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item Slope1 - Slope (\%) (1. Irrigrated agriculture, basin furrow irrigation) #' \item Slope2 - Slope (\%) (2. High level of managemnet with full mechanization. ) #' \item Slope3 - Slope (\%) (3. Low level of managemnet animal traction or handwork.) #' \item Flood - Flooding #' \item Drainage4 - Drainage (Medium and fine textured soils) #' \item Drainage5 - Drainage (Coarse textured soils - Sandy families) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 6 rows and 8 columns #' @name BARLEYTerrain NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/BARLEYTerrain.R
#' Barley water requirement for land evaluation #' #' A dataset containing the water characteristics of the crop requirements for farming Barley. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item WgAv - Precipitation of growing cycle (mm) #' \item WmAv2 - Mean precipitation of second month (mm) #' \item WmAv3 - Mean precipitation of third month (mm) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 3 rows and 8 columns #' @name BARLEYWater NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/BARLEYWater.R
#' Castor Beans soil requirement for land evaluation #' #' A dataset containing the soil characteristics of the crop requirements for farming Castor Beans. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item CFragm - Coarse fragment (Vol.\%) #' \item SoilDpt - Soil depth (cm) #' \item CECc - Apparent CEC Clay (cmol (+)/kg clay) #' \item BS - Base Saturation (\%) #' \item SumBCs - Sum of basic caions (cmol (+)/kg soil) #' \item pHH2O - pH H2O #' \item OC - Organic carbon (\%) #' \item ECedS - ECe (dS/m) #' \item ESP - ESP (\%) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 9 rows and 8 columns #' @name BEANCASoil NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/BEANCASoil.R
#' Castor Beans temp requirement for land evaluation #' #' A dataset containing the temp characteristics of the crop requirements for farming Castor Beans. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item TgAv - Mean temperature of the growing cycle (°C) #' \item TmAv1 - Mean temp. of the initial stage( C ) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 2 rows and 8 columns #' @name BEANCATemp NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/BEANCATemp.R
#' Castor Beans terrain requirement for land evaluation #' #' A dataset containing the terrain characteristics of the crop requirements for farming Castor Beans. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item Slope1 - Slope (\%) (1. Irrigrated agriculture, basin furrow irrigation) #' \item Slope2 - Slope (\%) (2. High level of managemnet with full mechanization. ) #' \item Slope3 - Slope (\%) (3. Low level of managemnet animal traction or handwork.) #' \item Flood - Flooding #' \item Drainage4 - Drainage (Medium and fine textured soils) #' \item Drainage5 - Drainage (Coarse textured soils - Sandy families) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 6 rows and 8 columns #' @name BEANCATerrain NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/BEANCATerrain.R
#' Castor Beans water requirement for land evaluation #' #' A dataset containing the water characteristics of the crop requirements for farming Castor Beans. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item WgAv - Precipitation of growing cycle (mm) #' \item WmhAv3 - Relative humidity of maturation Stage (\%) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 2 rows and 8 columns #' @name BEANCAWater NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/BEANCAWater.R
#' Beans soil requirement for land evaluation #' #' A dataset containing the soil characteristics of the crop requirements for farming Beans. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item CFragm - Coarse fragment (Vol.\%) #' \item SoilDpt - Soil depth (cm) #' \item CaCO3 - CaCO3 (\%) #' \item Gyps - Gypsum (\%) #' \item CECc - Apparent CEC Clay (cmol (+)/kg clay) #' \item BS - Base Saturation (\%) #' \item SumBCs - Sum of basic caions (cmol (+)/kg soil) #' \item pHH2O - pH H2O #' \item OC - Organic carbon (\%) #' \item ECedS - ECe (dS/m) #' \item ESP - ESP (\%) #' \item SoilTe - 12 classes of soil texture (Soil Taxonomy) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 12 rows and 8 columns #' @name BEANSSoil NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/BEANSSoil.R
#' Beans temp requirement for land evaluation #' #' A dataset containing the temp characteristics of the crop requirements for farming Beans. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item TgAv - Mean temperature of the growing cycle (°C) #' \item TgMinAv - Mean min. temp. of growing cycle (°C) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 2 rows and 8 columns #' @name BEANSTemp NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/BEANSTemp.R
#' Beans terrain requirement for land evaluation #' #' A dataset containing the terrain characteristics of the crop requirements for farming Beans. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item Slope1 - Slope (\%) (1. Irrigrated agriculture, basin furrow irrigation) #' \item Slope2 - Slope (\%) (2. High level of managemnet with full mechanization. ) #' \item Slope3 - Slope (\%) (3. Low level of managemnet animal traction or handwork.) #' \item Flood - Flooding #' \item Drainage4 - Drainage (Medium and fine textured soils) #' \item Drainage5 - Drainage (Coarse textured soils - Sandy families) #' \item SlopeD - Slope (degree, 6 classes) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 7 rows and 8 columns #' @name BEANSTerrain NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/BEANSTerrain.R
#' Beans water requirement for land evaluation #' #' A dataset containing the water characteristics of the crop requirements for farming Beans. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item WgAv - Precipitation of growing cycle (mm) #' \item WmhAv2 - Relative humidity of devel. Stage (\%) #' \item WmhAv3 - Relative humidity of maturation Stage (\%) #' \item WmnN2 - n/N develop. Stage (2nd month) #' \item WmnN4 - n/N maturation stage (4th month) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 5 rows and 8 columns #' @name BEANSWater NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/BEANSWater.R
#' Cabbage soil requirement for land evaluation #' #' A dataset containing the soil characteristics of the crop requirements for farming Cabbage. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item CFragm - Coarse fragment (Vol.\%) #' \item SoilDpt - Soil depth (cm) #' \item CaCO3 - CaCO3 (\%) #' \item Gyps - Gypsum (\%) #' \item CECc - Apparent CEC Clay (cmol (+)/kg clay) #' \item BS - Base Saturation (\%) #' \item SumBCs - Sum of basic caions (cmol (+)/kg soil) #' \item pHH2O - pH H2O #' \item OC - Organic carbon (\%) #' \item ECedS - ECe (dS/m) #' \item ESP - ESP (\%) #' \item SoilTe - 12 classes of soil texture (Soil Taxonomy) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 12 rows and 8 columns #' @name CABBAGESoil NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/CABBAGESoil.R
#' Cabbage temp requirement for land evaluation #' #' A dataset containing the temp characteristics of the crop requirements for farming Cabbage. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item TgAv - Mean temperature of the growing cycle (°C) #' \item TmAv0 - Mean temp. at germination (°C) (1st month) #' \item TdDiff - Temp diffrence day/night ( C ) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 3 rows and 8 columns #' @name CABBAGETemp NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/CABBAGETemp.R
#' Cabbage terrain requirement for land evaluation #' #' A dataset containing the terrain characteristics of the crop requirements for farming Cabbage. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item Slope1 - Slope (\%) (1. Irrigrated agriculture, basin furrow irrigation) #' \item Slope2 - Slope (\%) (2. High level of managemnet with full mechanization. ) #' \item Slope3 - Slope (\%) (3. Low level of managemnet animal traction or handwork.) #' \item Flood - Flooding #' \item Drainage4 - Drainage (Medium and fine textured soils) #' \item Drainage5 - Drainage (Coarse textured soils - Sandy families) #' \item SlopeD - Slope (degree, 6 classes) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 7 rows and 8 columns #' @name CABBAGETerrain NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/CABBAGETerrain.R
#' Cabbage water requirement for land evaluation #' #' A dataset containing the water characteristics of the crop requirements for farming Cabbage. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item WgAv - Precipitation of growing cycle (mm) #' \item WghAv - Relative humidity growing cycle (\%) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 2 rows and 8 columns #' @name CABBAGEWater NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/CABBAGEWater.R
#' Carrots soil requirement for land evaluation #' #' A dataset containing the soil characteristics of the crop requirements for farming Carrots. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item CFragm - Coarse fragment (Vol.\%) #' \item SoilDpt - Soil depth (cm) #' \item CaCO3 - CaCO3 (\%) #' \item Gyps - Gypsum (\%) #' \item CECc - Apparent CEC Clay (cmol (+)/kg clay) #' \item BS - Base Saturation (\%) #' \item SumBCs - Sum of basic caions (cmol (+)/kg soil) #' \item pHH2O - pH H2O #' \item OC - Organic carbon (\%) #' \item ECedS - ECe (dS/m) #' \item ESP - ESP (\%) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 11 rows and 8 columns #' @name CARROTSSoil NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/CARROTSSoil.R
#' Carrots temp requirement for land evaluation #' #' A dataset containing the temp characteristics of the crop requirements for farming Carrots. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item TgAv - Mean temperature of the growing cycle (°C) #' \item TmAv0 - Mean temp. at germination (°C) (1st month) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 2 rows and 8 columns #' @name CARROTSTemp NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/CARROTSTemp.R
#' Carrots terrain requirement for land evaluation #' #' A dataset containing the terrain characteristics of the crop requirements for farming Carrots. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item Slope1 - Slope (\%) (1. Irrigrated agriculture, basin furrow irrigation) #' \item Slope2 - Slope (\%) (2. High level of managemnet with full mechanization. ) #' \item Slope3 - Slope (\%) (3. Low level of managemnet animal traction or handwork.) #' \item Flood - Flooding #' \item Drainage4 - Drainage (Medium and fine textured soils) #' \item Drainage5 - Drainage (Coarse textured soils - Sandy families) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 6 rows and 8 columns #' @name CARROTSTerrain NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/CARROTSTerrain.R
#' Carrots water requirement for land evaluation #' #' A dataset containing the water characteristics of the crop requirements for farming Carrots. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item WgAv - Precipitation of growing cycle (mm) #' \item WghAv - Relative humidity growing cycle (\%) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 2 rows and 8 columns #' @name CARROTSWater NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/CARROTSWater.R
#' Cashew soil requirement for land evaluation #' #' A dataset containing the soil characteristics of the crop requirements for farming Cashew. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item CFragm - Coarse fragment (Vol.\%) #' \item SoilDpt - Soil depth (cm) #' \item BS - Base Saturation (\%) #' \item SumBCs - Sum of basic caions (cmol (+)/kg soil) #' \item pHH2O - pH H2O #' \item OC - Organic carbon (\%) #' \item ECedS - ECe (dS/m) #' \item ESP - ESP (\%) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 8 rows and 8 columns #' @name CASHEWSoil NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/CASHEWSoil.R
#' Cashew temp requirement for land evaluation #' #' A dataset containing the temp characteristics of the crop requirements for farming Cashew. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item TyMaxAv - Mean annual maximum temperature (°C) #' \item TmMinXm - Avarage minimum temperature of coldest month ( C ) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 2 rows and 8 columns #' @name CASHEWTemp NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/CASHEWTemp.R
#' Cashew terrain requirement for land evaluation #' #' A dataset containing the terrain characteristics of the crop requirements for farming Cashew. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item Slope1 - Slope (\%) (1. Irrigrated agriculture, basin furrow irrigation) #' \item Slope2 - Slope (\%) (2. High level of managemnet with full mechanization. ) #' \item Slope3 - Slope (\%) (3. Low level of managemnet animal traction or handwork.) #' \item Flood - Flooding #' \item Drainage4 - Drainage (Medium and fine textured soils) #' \item Drainage5 - Drainage (Coarse textured soils - Sandy families) #' \item SlopeD - Slope (degree, 6 classes) #' \item SoilTe - 12 classes of soil texture (Soil Taxonomy) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 8 rows and 8 columns #' @name CASHEWTerrain NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/CASHEWTerrain.R
#' Cashew water requirement for land evaluation #' #' A dataset containing the water characteristics of the crop requirements for farming Cashew. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item WyAv - Annual precipitation (mm) #' \item WmDryLen - Length dry season (months : P < 1/2 PET) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 2 rows and 8 columns #' @name CASHEWWater NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/CASHEWWater.R
#' Cassava soil requirement for land evaluation #' #' A dataset containing the soil characteristics of the crop requirements for farming Cassava. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item CFragm1 - Coarse fragment in surface (Vol.\%) #' \item CFragm2 - Coarse fragment in depth (Vol.\%) #' \item SoilDpt - Soil depth (cm) #' \item CaCO3 - CaCO3 (\%) #' \item Gyps - Gypsum (\%) #' \item CECc - Apparent CEC Clay (cmol (+)/kg clay) #' \item BS - Base Saturation (\%) #' \item SumBCs - Sum of basic caions (cmol (+)/kg soil) #' \item pHH2O - pH H2O #' \item OC - Organic carbon (\%) #' \item ECedS - ECe (dS/m) #' \item SoilTe - 12 classes of soil texture (Soil Taxonomy) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 12 rows and 8 columns #' @name CASSAVASoil NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/CASSAVASoil.R
#' Cassava temp requirement for land evaluation #' #' A dataset containing the temp characteristics of the crop requirements for farming Cassava. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item TyMaxAv - Mean annual maximum temperature (°C) #' \item TmMinXmAb - Absolute min temp. coldest month (°C) #' \item TgAv - Mean temperature of the growing cycle (°C) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 3 rows and 8 columns #' @name CASSAVATemp NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/CASSAVATemp.R
#' Cassava terrain requirement for land evaluation #' #' A dataset containing the terrain characteristics of the crop requirements for farming Cassava. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item Slope1 - Slope (\%) (1. Irrigrated agriculture, basin furrow irrigation) #' \item Slope2 - Slope (\%) (2. High level of managemnet with full mechanization. ) #' \item Slope3 - Slope (\%) (3. Low level of managemnet animal traction or handwork.) #' \item Flood - Flooding #' \item Drainage - Drainage #' \item SlopeD - Slope (degree, 6 classes) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 6 rows and 8 columns #' @name CASSAVATerrain NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/CASSAVATerrain.R
#' Cassava water requirement for land evaluation #' #' A dataset containing the water characteristics of the crop requirements for farming Cassava. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item WyAv - Annual precipitation (mm) #' \item WmDryLen - Length dry season (months : P < 1/2 PET) #' \item WmnN5 - n/N of the 5 dryest months #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 3 rows and 8 columns #' @name CASSAVAWater NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/CASSAVAWater.R
#' Chickpea soil requirement for land evaluation #' #' A dataset containing the soil characteristics of the crop requirements for farming Chickpea. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item CFragm - Coarse fragment (Vol.\%) #' \item SoilDpt - Soil depth (cm) #' \item CaCO3 - CaCO3 (\%) #' \item Gyps - Gypsum (\%) #' \item CECc - Apparent CEC Clay (cmol (+)/kg clay) #' \item BS - Base Saturation (\%) #' \item SumBCs - Sum of basic caions (cmol (+)/kg soil) #' \item pHH2O - pH H2O #' \item OC - Organic carbon (\%) #' \item ECedS - ECe (dS/m) #' \item ESP - ESP (\%) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 11 rows and 8 columns #' @name CHICKPEASoil NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/CHICKPEASoil.R
#' Chickpea temp requirement for land evaluation #' #' A dataset containing the temp characteristics of the crop requirements for farming Chickpea. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item TgAv - Mean temperature of the growing cycle (°C) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 1 rows and 8 columns #' @name CHICKPEATemp NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/CHICKPEATemp.R
#' Chickpea terrain requirement for land evaluation #' #' A dataset containing the terrain characteristics of the crop requirements for farming Chickpea. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item Slope1 - Slope (\%) (1. Irrigrated agriculture, basin furrow irrigation) #' \item Slope2 - Slope (\%) (2. High level of managemnet with full mechanization. ) #' \item Slope3 - Slope (\%) (3. Low level of managemnet animal traction or handwork.) #' \item Flood - Flooding #' \item Drainage4 - Drainage (Medium and fine textured soils) #' \item Drainage5 - Drainage (Coarse textured soils - Sandy families) #' \item SlopeD - Slope (degree, 6 classes) #' \item SoilTe - 12 classes of soil texture (Soil Taxonomy) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 8 rows and 8 columns #' @name CHICKPEATerrain NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/CHICKPEATerrain.R
#' Chickpea water requirement for land evaluation #' #' A dataset containing the water characteristics of the crop requirements for farming Chickpea. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item WgAv - Precipitation of growing cycle (mm) #' \item WmAv3 - Mean precipitation of third month (mm) #' \item WmAv4 - Mean precipitation of fourth month (mm) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 3 rows and 8 columns #' @name CHICKPEAWater NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/CHICKPEAWater.R
#' Cinnamon soil requirement for land evaluation #' #' A dataset containing the soil characteristics of the crop requirements for farming Cinnamon. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item CFragm - Coarse fragment (Vol.\%) #' \item SoilDpt - Soil depth (cm) #' \item CaCO3 - CaCO3 (\%) #' \item Gyps - Gypsum (\%) #' \item CECc - Apparent CEC Clay (cmol (+)/kg clay) #' \item BS - Base Saturation (\%) #' \item SumBCs - Sum of basic caions (cmol (+)/kg soil) #' \item pHH2O - pH H2O #' \item OC - Organic carbon (\%) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 9 rows and 8 columns #' @name CINNAMONSoil NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/CINNAMONSoil.R
#' Cinnamon temp requirement for land evaluation #' #' A dataset containing the temp characteristics of the crop requirements for farming Cinnamon. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item TgAv - Mean temperature of the growing cycle (°C) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 1 rows and 8 columns #' @name CINNAMONTemp NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/CINNAMONTemp.R
#' Cinnamon terrain requirement for land evaluation #' #' A dataset containing the terrain characteristics of the crop requirements for farming Cinnamon. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item SlopeD - Slope (degree, 6 classes) #' \item Flood - Flooding #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 2 rows and 8 columns #' @name CINNAMONTerrain NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/CINNAMONTerrain.R
#' Cinnamon water requirement for land evaluation #' #' A dataset containing the water characteristics of the crop requirements for farming Cinnamon. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item WgAv - Precipitation of growing cycle (mm) #' \item WghAv - Relative humidity growing cycle (\%) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 2 rows and 8 columns #' @name CINNAMONWater NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/CINNAMONWater.R
#' Citrus soil requirement for land evaluation #' #' A dataset containing the soil characteristics of the crop requirements for farming Citrus. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item CFragm - Coarse fragment (Vol.\%) #' \item SoilDpt - Soil depth (cm) #' \item CaCO3 - CaCO3 (\%) #' \item Gyps - Gypsum (\%) #' \item CECc - Apparent CEC Clay (cmol (+)/kg clay) #' \item BS - Base Saturation (\%) #' \item SumBCs - Sum of basic caions (cmol (+)/kg soil) #' \item pHH2O - pH H2O #' \item OC - Organic carbon (\%) #' \item ECedS - ECe (dS/m) #' \item ESP - ESP (\%) #' \item SoilTe - 12 classes of soil texture (Soil Taxonomy) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 12 rows and 8 columns #' @name CITRUSSoil NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/CITRUSSoil.R
#' Citrus temp requirement for land evaluation #' #' A dataset containing the temp characteristics of the crop requirements for farming Citrus. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item TyAv - Mean annual temperature (°C) #' \item TmMax38 - No of months with mean temp. > 38 °C #' \item TmMin13 - No of months with mean temp. < 13 °C #' \item TyMinAb - Absolute minimum temperature (°C) #' \item TyMinAb - Absolute minimum temperature (°C) #' \item TyMinAb - Absolute minimum temperature (°C) #' \item TyMinAb - Absolute minimum temperature (°C) #' \item TmAv3 - Mean temp. of the flowering stage (°C) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 8 rows and 8 columns #' @name CITRUSTemp NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/CITRUSTemp.R
#' Citrus terrain requirement for land evaluation #' #' A dataset containing the terrain characteristics of the crop requirements for farming Citrus. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item Slope1 - Slope (\%) (1. Irrigrated agriculture, basin furrow irrigation) #' \item Slope2 - Slope (\%) (2. High level of managemnet with full mechanization. ) #' \item Slope3 - Slope (\%) (3. Low level of managemnet animal traction or handwork.) #' \item Flood - Flooding #' \item Drainage - Drainage #' \item SlopeD - Slope (degree, 6 classes) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 6 rows and 8 columns #' @name CITRUSTerrain NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/CITRUSTerrain.R
#' Citrus water requirement for land evaluation #' #' A dataset containing the water characteristics of the crop requirements for farming Citrus. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item WyAv - Annual precipitation (mm) #' \item WmDryLen - Length dry season (months : P < 1/2 PET) #' \item WmhColdXm - Relative humidity of coldest month if frost (\%) #' \item WmhAv4 - Relative humidity at harvest stage (\%) #' \item WmhAv3 - Relative humidity of maturation Stage (\%) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 5 rows and 8 columns #' @name CITRUSWater NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/CITRUSWater.R
#' Cocoa soil requirement for land evaluation #' #' A dataset containing the soil characteristics of the crop requirements for farming Cocoa. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item CFragm - Coarse fragment (Vol.\%) #' \item SoilDpt - Soil depth (cm) #' \item CaCO3 - CaCO3 (\%) #' \item Gyps - Gypsum (\%) #' \item CECc - Apparent CEC Clay (cmol (+)/kg clay) #' \item BS - Base Saturation (\%) #' \item SumBCs - Sum of basic caions (cmol (+)/kg soil) #' \item pHH2O - pH H2O #' \item OC - Organic carbon (\%) #' \item ECedS - ECe (dS/m) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 10 rows and 8 columns #' @name COCOASoil NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/COCOASoil.R
#' Cocoa temp requirement for land evaluation #' #' A dataset containing the temp characteristics of the crop requirements for farming Cocoa. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item TyAv - Mean annual temperature (°C) #' \item TyMaxAv - Mean annual maximum temperature (°C) #' \item TyMaxAv - Mean annual maximum temperature (°C) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 3 rows and 8 columns #' @name COCOATemp NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/COCOATemp.R
#' Cocoa terrain requirement for land evaluation #' #' A dataset containing the terrain characteristics of the crop requirements for farming Cocoa. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item Slope1 - Slope (\%) (1. Irrigrated agriculture, basin furrow irrigation) #' \item Slope2 - Slope (\%) (2. High level of managemnet with full mechanization. ) #' \item Slope3 - Slope (\%) (3. Low level of managemnet animal traction or handwork.) #' \item Flood - Flooding #' \item Drainage - Drainage #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 5 rows and 8 columns #' @name COCOATerrain NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/COCOATerrain.R
#' Cocoa water requirement for land evaluation #' #' A dataset containing the water characteristics of the crop requirements for farming Cocoa. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item WyAv - Annual precipitation (mm) #' \item WmDryLen - Length dry season (months : P < 1/2 PET) #' \item WmhDryXm - Mean rel. humidity dryest month (\%) #' \item WmhDryXm - Mean rel. humidity dryest month (\%) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 4 rows and 8 columns #' @name COCOAWater NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/COCOAWater.R
#' Coconut soil requirement for land evaluation #' #' A dataset containing the soil characteristics of the crop requirements for farming Coconut. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item CFragm - Coarse fragment (Vol.\%) #' \item SoilDpt - Soil depth (cm) #' \item BS - Base Saturation (\%) #' \item SumBCs - Sum of basic caions (cmol (+)/kg soil) #' \item OC - Organic carbon (\%) #' \item ECemh - ECe (mmhos/cm) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 6 rows and 8 columns #' @name COCONUTSoil NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/COCONUTSoil.R
#' Coconut temp requirement for land evaluation #' #' A dataset containing the temp characteristics of the crop requirements for farming Coconut. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item TyAv - Mean annual temperature (°C) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 1 rows and 8 columns #' @name COCONUTTemp NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/COCONUTTemp.R
#' Coconut terrain requirement for land evaluation #' #' A dataset containing the terrain characteristics of the crop requirements for farming Coconut. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item Slope1 - Slope (\%) (1. Irrigrated agriculture, basin furrow irrigation) #' \item Slope2 - Slope (\%) (2. High level of managemnet with full mechanization. ) #' \item Slope3 - Slope (\%) (3. Low level of managemnet animal traction or handwork.) #' \item Flood - Flooding #' \item Drainage - Drainage #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 5 rows and 8 columns #' @name COCONUTTerrain NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/COCONUTTerrain.R
#' Coconut water requirement for land evaluation #' #' A dataset containing the water characteristics of the crop requirements for farming Coconut. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item WyAv - Annual precipitation (mm) #' \item WmDryLen - Length dry season (months : P < 1/2 PET) #' \item WyhAv - Mean annual rel. humidity (\%) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 3 rows and 8 columns #' @name COCONUTWater NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/COCONUTWater.R
#' Arabica Coffee soil requirement for land evaluation #' #' A dataset containing the soil characteristics of the crop requirements for farming Arabica Coffee. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item CFragm - Coarse fragment (Vol.\%) #' \item SoilDpt - Soil depth (cm) #' \item CaCO3 - CaCO3 (\%) #' \item Gyps - Gypsum (\%) #' \item CECc - Apparent CEC Clay (cmol (+)/kg clay) #' \item BS - Base Saturation (\%) #' \item SumBCs - Sum of basic caions (cmol (+)/kg soil) #' \item pHH2O - pH H2O #' \item OC - Organic carbon (\%) #' \item ECedS - ECe (dS/m) #' \item SoilTe - 12 classes of soil texture (Soil Taxonomy) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 11 rows and 8 columns #' @name COFFEEARSoil NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/COFFEEARSoil.R
#' Arabica Coffee temp requirement for land evaluation #' #' A dataset containing the temp characteristics of the crop requirements for farming Arabica Coffee. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item TyMaxAv - Mean annual maximum temperature (°C) #' \item TdMinXm - Mean daily minimum temperature of coldest month (°C) #' \item TyAv - Mean annual temperature (°C) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 3 rows and 8 columns #' @name COFFEEARTemp NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/COFFEEARTemp.R
#' Arabica Coffee terrain requirement for land evaluation #' #' A dataset containing the terrain characteristics of the crop requirements for farming Arabica Coffee. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item Slope1 - Slope (\%) (1. Irrigrated agriculture, basin furrow irrigation) #' \item Slope2 - Slope (\%) (2. High level of managemnet with full mechanization. ) #' \item Slope3 - Slope (\%) (3. Low level of managemnet animal traction or handwork.) #' \item Flood - Flooding #' \item Drainage - Drainage #' \item SlopeD - Slope (degree, 6 classes) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 6 rows and 8 columns #' @name COFFEEARTerrain NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/COFFEEARTerrain.R
#' Arabica Coffee water requirement for land evaluation #' #' A dataset containing the water characteristics of the crop requirements for farming Arabica Coffee. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item WyAv - Annual precipitation (mm) #' \item WmDryLen - Length dry season (months : P < 1/2 PET) #' \item WmhDryXm - Mean rel. humidity dryest month (\%) #' \item WmnN5 - n/N of the 5 dryest months #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 4 rows and 8 columns #' @name COFFEEARWater NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/COFFEEARWater.R
#' Robusta Coffee soil requirement for land evaluation #' #' A dataset containing the soil characteristics of the crop requirements for farming Robusta Coffee. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item CFragm - Coarse fragment (Vol.\%) #' \item SoilDpt - Soil depth (cm) #' \item CaCO3 - CaCO3 (\%) #' \item Gyps - Gypsum (\%) #' \item CECc - Apparent CEC Clay (cmol (+)/kg clay) #' \item BS - Base Saturation (\%) #' \item SumBCs - Sum of basic caions (cmol (+)/kg soil) #' \item pHH2O - pH H2O #' \item OC - Organic carbon (\%) #' \item ECedS - ECe (dS/m) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 10 rows and 8 columns #' @name COFFEEROSoil NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/COFFEEROSoil.R
#' Robusta Coffee temp requirement for land evaluation #' #' A dataset containing the temp characteristics of the crop requirements for farming Robusta Coffee. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item TyAv - Mean annual temperature (°C) #' \item TyMaxAv - Mean annual maximum temperature (°C) #' \item TdMinXm - Mean daily minimum temperature of coldest month (°C) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 3 rows and 8 columns #' @name COFFEEROTemp NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/COFFEEROTemp.R
#' Robusta Coffee terrain requirement for land evaluation #' #' A dataset containing the terrain characteristics of the crop requirements for farming Robusta Coffee. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item Slope1 - Slope (\%) (1. Irrigrated agriculture, basin furrow irrigation) #' \item Slope2 - Slope (\%) (2. High level of managemnet with full mechanization. ) #' \item Slope3 - Slope (\%) (3. Low level of managemnet animal traction or handwork.) #' \item Flood - Flooding #' \item Drainage - Drainage #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 5 rows and 8 columns #' @name COFFEEROTerrain NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/COFFEEROTerrain.R
#' Robusta Coffee water requirement for land evaluation #' #' A dataset containing the water characteristics of the crop requirements for farming Robusta Coffee. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item WyAv - Annual precipitation (mm) #' \item WmDryLen - Length dry season (months : P < 1/2 PET) #' \item WmhDryXm - Mean rel. humidity dryest month (\%) #' \item WmnN5 - n/N of the 5 dryest months #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 4 rows and 8 columns #' @name COFFEEROWater NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/COFFEEROWater.R
#' Cotton soil requirement for land evaluation #' #' A dataset containing the soil characteristics of the crop requirements for farming Cotton. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item CFragm - Coarse fragment (Vol.\%) #' \item SoilDpt - Soil depth (cm) #' \item CaCO3 - CaCO3 (\%) #' \item Gyps - Gypsum (\%) #' \item CECc - Apparent CEC Clay (cmol (+)/kg clay) #' \item BS - Base Saturation (\%) #' \item SumBCs - Sum of basic caions (cmol (+)/kg soil) #' \item pHH2O - pH H2O #' \item OC6 - Organic carbon (\%) - Kaolinitic materials #' \item OC7 - Organic carbon (\%) - Non Kaolinitic, Non calcareous materials #' \item OC8 - Organic carbon (\%) - Calcareous materials #' \item ECemh - ECe (mmhos/cm) #' \item SoilTe - 12 classes of soil texture (Soil Taxonomy) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 13 rows and 8 columns #' @name COTTONSoil NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/COTTONSoil.R
#' Cotton temp requirement for land evaluation #' #' A dataset containing the temp characteristics of the crop requirements for farming Cotton. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item TgAv - Mean temperature of the growing cycle (°C) #' \item TgMaxAv - Mean max temp. of growing cycle (°C) #' \item TmMaxXm - Average max. temp. warmest month (°C) #' \item TmAv2 - Mean temp. crop development stage (2nd month) (°C) #' \item TdAvg3 - Mean DAY temp. of flowering stage (°C) #' \item TdMinN3 - Mean Night temp. of flowering stage (°C) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 6 rows and 8 columns #' @name COTTONTemp NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/COTTONTemp.R
#' Cotton terrain requirement for land evaluation #' #' A dataset containing the terrain characteristics of the crop requirements for farming Cotton. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item Slope1 - Slope (\%) (1. Irrigrated agriculture, basin furrow irrigation) #' \item Slope2 - Slope (\%) (2. High level of managemnet with full mechanization. ) #' \item Slope3 - Slope (\%) (3. Low level of managemnet animal traction or handwork.) #' \item Flood - Flooding #' \item Drainage4 - Drainage (Medium and fine textured soils) #' \item Drainage5 - Drainage (Coarse textured soils - Sandy families) #' \item Slope - nan #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 7 rows and 8 columns #' @name COTTONTerrain NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/COTTONTerrain.R
#' Cotton water requirement for land evaluation #' #' A dataset containing the water characteristics of the crop requirements for farming Cotton. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item WgAv - Precipitation of growing cycle (mm) #' \item WmAv1 - Mean precipitation of first month (mm) #' \item WmAv2 - Mean precipitation of second month (mm) #' \item WmAv5 - Mean precipitation of fifth month (mm) #' \item WmAv6 - Precipitation of ripening stage (mm)(6th month) #' \item WmhAv3 - Relative humidity of maturation Stage (\%) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 6 rows and 8 columns #' @name COTTONWater NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/COTTONWater.R
#' Cowpea soil requirement for land evaluation #' #' A dataset containing the soil characteristics of the crop requirements for farming Cowpea. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item CFragm - Coarse fragment (Vol.\%) #' \item SoilDpt - Soil depth (cm) #' \item CaCO3 - CaCO3 (\%) #' \item Gyps - Gypsum (\%) #' \item CECc - Apparent CEC Clay (cmol (+)/kg clay) #' \item BS - Base Saturation (\%) #' \item SumBCs - Sum of basic caions (cmol (+)/kg soil) #' \item pHH2O - pH H2O #' \item OC - Organic carbon (\%) #' \item ECedS - ECe (dS/m) #' \item SoilTe - 12 classes of soil texture (Soil Taxonomy) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 11 rows and 8 columns #' @name COWPEASoil NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/COWPEASoil.R
#' Cowpea temp requirement for land evaluation #' #' A dataset containing the temp characteristics of the crop requirements for farming Cowpea. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item TgAv - Mean temperature of the growing cycle (°C) #' \item TmAv0 - Mean temp. at germination (°C) (1st month) #' \item TyMinAv - Mean annual minimum temperature (°C) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 3 rows and 8 columns #' @name COWPEATemp NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/COWPEATemp.R
#' Cowpea terrain requirement for land evaluation #' #' A dataset containing the terrain characteristics of the crop requirements for farming Cowpea. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item Slope1 - Slope (\%) (1. Irrigrated agriculture, basin furrow irrigation) #' \item Slope2 - Slope (\%) (2. High level of managemnet with full mechanization. ) #' \item Slope3 - Slope (\%) (3. Low level of managemnet animal traction or handwork.) #' \item Flood - Flooding #' \item Drainage4 - Drainage (Medium and fine textured soils) #' \item Drainage5 - Drainage (Coarse textured soils - Sandy families) #' \item SlopeD - Slope (degree, 6 classes) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 7 rows and 8 columns #' @name COWPEATerrain NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/COWPEATerrain.R
#' Cowpea water requirement for land evaluation #' #' A dataset containing the water characteristics of the crop requirements for farming Cowpea. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item WgAv - Precipitation of growing cycle (mm) #' \item WmAv1 - Mean precipitation of first month (mm) #' \item WmAv2 - Mean precipitation of second month (mm) #' \item WmAv3 - Mean precipitation of third month (mm) #' \item WmAv4 - Mean precipitation of fourth month (mm) #' \item WmhAv4 - Relative humidity at harvest stage (\%) #' } #' @seealso #' \itemize{ #' \item Yen, B. T., Pheng, K. S., and Hoanh, C. T. (2006). \emph{LUSET: Land Use Suitability Evaluation Tool User's Guide}. International Rice Research Institute. #' } #' #' @docType data #' @keywords dataset #' @format A data frame with 6 rows and 8 columns #' @name COWPEAWater NULL
/scratch/gouwar.j/cran-all/cranData/ALUES/R/COWPEAWater.R