##' Take characters from the left-hand side of a string
##'
##' @param x A vector of character strings
##' @param out_length The number of characters starting from the left
##' @author David Whiting, david.whiting@@publichealth.me.uk
##' @export
##'
left <- function(x, out_length) {
ret <- substring(x, 1, out_length)
if (any(length(ret) < out_length))
warning(paste("Some values are shorter than", out_length, "characters."))
ret
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.