#' ncw
#'
#' Count number of common words in two strings
#' @param str1 string or string vector 1
#' @param str2 string or string vector 2
#' @export
ncw <- function(str1, str2) {
mapply(function(x, y) length(intersect(x, y)),
strsplit(str1, ' '), strsplit(str2, ' '))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.