R/tau2type.R

Defines functions tau2type

Documented in tau2type

#' @rdname tau-utils
#' @description
#' \code{tau2type} guesses the type (\code{'s'}, \code{'h'}, \code{'hh'}) from the names
#' of \code{tau} vector; thus make sure \code{tau} is named correctly.
#' @export
#' 
#' 

tau2type <- function(tau) {
  
  if (!("gamma" %in% names(tau))) {
    tau["gamma"] <- 0
  }
  if (tau["gamma"] == 0) {
    if (any(grepl("_l|_r", names(tau)))) {
      type <- "hh"
    } else {
      type <- "h"
    }
  } else {
    type <- "s"
  }
  return(type)
}

Try the LambertW package in your browser

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

LambertW documentation built on May 29, 2024, 4:30 a.m.