#' tx_get_dtm
#'
#' @param text A string vector
#' @param id a unique identifier
#' @param vec a pre built word vectorizer
#' @return a dtm
#'
#' @export
tx_get_dtm <- function(text, id, vec){
dtm <- text %>%
itoken(ids = id, progressbar = FALSE) %>%
create_dtm(vec)
return(dtm)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.