R/createInvLink.R

Defines functions createInvLink

Documented in createInvLink

#' Return inverse link function for plot_shiny.fpca()
#' 
#' Internal method that constructs the inverse link function for a 
#' generalized FPCA fit. This is used in toggling between plots on the
#' natural scale and on the response scale. 
#' 
#' @param family Family of the (generalized) FPCA. Currently supported families
#' are \code{gaussian} and \code{binomial}.
#' 
#' @author Jeff Goldsmith \email{ajg2202@@cumc.columbia.edu}
#' 
createInvLink = function(family = NULL){
  
  if (is.null(family) || family == "gaussian") {
    f = function(x){
      x
    }
  } else if (family == "binomial") {
    f = function(x){
      exp(x) / (1 + exp(x))
    } 
  } else if (family == "poisson") {
  	f = function(x){
  		exp(x)
  	} 
  }
  
}

Try the refund.shiny package in your browser

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

refund.shiny documentation built on Oct. 11, 2022, 1:05 a.m.