R/logit.R

Defines functions logit

Documented in logit

#' logit
#'
#'
#' Takes in a vector and applies the logit function elementwise to that vector
#' 
#' @name logit
#' @param x : numeric vector, whose entries should be strictly between 0 and 1
#' @return logit(x)
#' @keywords internal
logit <- function(x) {
    if ((sum(x >= 1) != 0) | (sum(x <= 0) != 0)) 
        print("ERROR IN LOGIT: DIVIDING BY ZERO") else log(x/(1 - x))
}

Try the PAIRADISE package in your browser

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

PAIRADISE documentation built on Nov. 8, 2020, 8:22 p.m.