#' @title Transform by format
#'
#' @description Converts the input by from the Confluence table into adequate format.
#'
#' @author Briac LE RAY (briac.leray@partnre.com)
#'
#' @return Returns a string matching the "by" format used in the merge function.
#' @param by_x_y The string to be transformed. Type = character
#' @examples transform_by_x_y(by_x_y = "attribute_1, attribute_2")
#' returns : "c("attribute_1", "attribute_2")"
transform_by_x_y <- function(by_x_y) {
by_x_y <- unlist(strsplit(x = by_x_y, split = ","))
by_x_y <- str_replace_all(string = by_x_y, pattern = " ", replacement = "")
by_x_y <- paste(by_x_y, collapse = "\", \"")
by_x_y <- paste("c(\"", by_x_y, "\")", sep = "")
return(by_x_y)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.