#' @title Simplify strsplit functionality
#'
#' @description
#' \code{splitText} Loops along a string splitting text by sep and returning
#' the element num of that split text
#'
#' @param x A character vector, if not character, function coerces it to character.
#' @param sep The character that separates values
#' @param num The index of the split vector to return.
#' @export
splitText<-function(x, sep = "_", num = 1){
x<-as.character(x)
sapply(x, function(y) strsplit(y, sep)[[1]][num])
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.