R/l1score.R

Defines functions l1score

Documented in l1score

l1score <-
function(x){
	stopifnot(is.vector(x) & is.numeric(x))
	if(sum(is.na(x)) == length(x)){return(rep(1, length(x)))}
	stopifnot(is.numeric(x))
	x <- abs(x)
	1 - x / max(c(1, x), na.rm = TRUE)
}

Try the KOR.addrlink package in your browser

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

KOR.addrlink documentation built on May 29, 2024, 4 a.m.