#' Repeat elements of a character vector `times` times and collapse it
#'
#' @param char A character vector.
#' @param times an integer giving the number of repetitions.
#' @return A character vector.
#' @keywords internal
rep_char <- function(char, times) {
paste(rep.int(char, times), collapse = "")
}
#' Concentrate newlines or spaces in a string
#'
#' @param n Scalar indicating how many characters should be concentrated
#' @return A string.
#' @name add_spaces_or_newlines
#' @keywords internal
NULL
#' @rdname add_spaces_or_newlines
#' @keywords internal
add_newlines <- function(n) {
rep_char("\n", n)
}
#' @rdname add_spaces_or_newlines
#' @keywords internal
add_spaces <- function(n) {
rep_char(" ", n)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.