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)
}
dcaseykc/dtsurvey documentation built on March 9, 2024, 1:09 p.m.