R/ldc.disj.R

ldc.disj<-
		function (...){
	s<-1
	n <- length(list(...))
	if (n > 1) {
		for (a in list(...)) { 
			b<-as.vector(a)
			if (any(b<0|b>1)) { 
				stop("Error...the value is not a value trust")
			}
			else {		
				var1<-1-a		
				s <- s * var1
			}
		}
		result1 <- (s)^(1/n)
		result<- 1-result1 
		return(result)
	}
	if (n == 1) {
		if (is.vector((...), mode = "any")) {
			value<-(...)		
			if (any(as.vector(value)<0|as.vector(value)>1)) { 
				stop("Error...the value is not a value trust")
			}
			var1<-1-value
			var2<-prod(var1)
			var3<-(var2)^(1/length(value))
			var4<-1-var3
			return (var4)
		}
		if (!is.vector((...), mode = "any")) {
			value<-	(...)
			if (any(as.vector(value)<0|as.vector(value)>1)) { 
				stop("Error...the value is not a value trust")
			}
			col<-ncol(value)
			row<-nrow(value)
			valor<-matrix(as.matrix(value), nrow=row, ncol=col, byrow=FALSE)
			var1<-1-valor
			var2<-apply(var1,2,prod)
			var3<-(var2)^(1/row)
			var4<-1-var3
			return (var4)
		}
	}
}

Try the CFL package in your browser

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

CFL documentation built on May 2, 2019, 5:18 p.m.