R/getfunnm.R

Defines functions getfunnm

Documented in getfunnm

#' @rdname internal_desc
#' @export
getfunnm <- function(x){
  if(length(grep(".Primitive", deparse(x))) > 0){
    if(length(grep("max", deparse(x))) > 0){
      funnm <- "max"
    }else if(length(grep("min", deparse(x))) > 0){
      funnm <- "min"
    }else if(length(grep("sum", deparse(x))) > 0){
      funnm <- "sum"
    }
  }else if(length(grep("standardGeneric", deparse(x))) > 0){
    if(length(grep("mean", deparse(x))) > 0){
      funnm <- "mean"
    }
  }else{
    warning("unknown function")
    funnm <- "fun"
  }
  return(funnm)
}

Try the FIESTAutils package in your browser

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

FIESTAutils documentation built on May 29, 2024, 4:06 a.m.