R/utils.R

##' Get numbers
##' 
##' Get numbers (e.g., from string or other format)
##' @title Get Nums
##' @param x 
##' @return GHGVC output 
##' @export
##' @author David LeBauer
get.nums <- function(x){
  options(warn=FALSE)
  if(is.na(as.numeric(x))){
    if(is.na(as.logical(x))){
      x <-  as.character(x)
    } else {
      x <-    as.logical(x)
    }
  } else {
    x <-  as.numeric(x)
  }
  print(x)
  return(x)
  options(warn = TRUE)
}        
dlebauer/ghgvcR documentation built on May 15, 2019, 9:14 a.m.