https://github.com/cran/robCompositions
Raw File
Tip revision: d43cd20e55d3a1691b396cc30772f2e5a2945e82 authored by Matthias Templ on 29 November 2009, 19:35:41 UTC
version 1.3.2
Tip revision: d43cd20
invclr.R
invclr <- function(x, useClassInfo=TRUE){
	if(class(x) != "clr" & useClassInfo == TRUE) warning("useClassInfo was set to FALSE, because x is not from class clr")
	if(!(class(x) %in% c("clr", "data.frame", "matrix"))) stop("class from x must be either clr, data.frame or matrix")
	xclr <- x$x.clr
	if(class(x) == "clr" & useClassInfo==TRUE){
		dat <- exp(xclr)  * x$gm
	} else if(class(x) != "clr" | useClassInfo==FALSE){
		dat <- exp(x)  		
	}
	invisible(dat)	
}
back to top