R/get_marked_value_today.R

Defines functions get_market_value_today

Documented in get_market_value_today

#' Get marked value today
#' @param x numeric vector
#' 
get_market_value_today <- function(x) {
  
  x <- x[!is.na(x)]
  
  y <- x[length(x)] %>% round(1)
  
  if (length(y) == 0) {
    return(NA)
  } else {
    return(y)
  }
  
}
kristian-bak/shinyStocks documentation built on Aug. 16, 2022, 4:15 a.m.