R/de_var.R

Defines functions de_var

Documented in de_var

#' de_var
#'
#' Convert a variable name in English to it's German equivalent - to be used with the seoneugelb package
#' @param x The input, could be a vector or a column
#' @export

de_var <- function(x) {

require(tidyverse)

if(x %in% c('ctr','clicks','impressions')) {
 ifelse(x == 'ctr',str_to_upper(x),
  ifelse(x == 'clicks','Klicks','Impressionen'))
  } else {
  stop('Bad variable - try again')
  }

}
neugelb/neugelbtools documentation built on July 7, 2020, 1:17 a.m.