R/utilities.R

Defines functions delist_factor expit

Documented in delist_factor expit

#' Inverse logit transform
#' @param eta numeric to inverse logit transform
expit <- function(eta){
  exp(eta)/(1 + exp(eta))
}

#' Unlist by a single level, used for survey factors results
#' @param x list (with a factor inside of it) to delist.
#' @export
delist_factor = function(x){
  stopifnot(inherits(x, 'list'))
  unlist(x, recursive = FALSE)
}
PHSKC-APDE/dtsurvey documentation built on March 6, 2024, 2:14 p.m.