R/utility.R

Defines functions get_var_names

Documented in get_var_names

################################################################################
#
#' Utility function to exract indicator names/description using a vector of
#' corresponding indicator codes.
#'
#' @param x A vector of indicator codes to create indicators names from
#' @param steer A data frame containing information on indicator names/description
#'     for each indicator code
#' @return A list of indicator names/description corresponding to the indicator
#'     codes
#' @examples
#' #
#' get_var_names(x = c("jmpWater1", "jmpWater2", "jmpWater3", "jmpWater4", "jmpWater5"),
#'               steer = steerIndicators)
#'               
#' @export
#'
#
################################################################################

get_var_names <- function(x, steer) {
  
  var.names <- as.character(steer$varNames[steer$varList == x])
  
  return(var.names)
}
validmeasures/wsup documentation built on Dec. 16, 2019, 4:50 a.m.