#' de_months
#'
#' An easy function for converting English to German month names for time tables, or in a column
#' @param x Your data
#' @param type Either 'columns' or 'data'
#' @export
de_months <- function(x,type) {
if (type == 'columns') {
z <- colnames(x)
z <- gsub('May','Mai',z)
z <- gsub('Mar','Mär',z)
z <- gsub('Oct','Okt',z)
z <- gsub('Dec','Dez',z)
colnames(x) <- z
} else if (type == 'data') {
a <- as.character(x)
x <- gsub('May','Mai',x)
x <- gsub('Mar','Mär',x)
x <- gsub('Oct','Okt',x)
x <- gsub('Dec','Dez',x)
} else if (type == 'data_full') {
a <- as.character(x)
x <- gsub('May','Mai',x)
x <- gsub('March','März',x)
x <- gsub('June','Juni',x)
x <- gsub('July','Juli',x)
x <- gsub('October','Oktober',x)
x <- gsub('December','Dezember',x)
x <- gsub('January','Januar',x)
x <- gsub('February','Februar',x)
}
return(x)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.