Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
15 lines (14 sloc) 272 Bytes
#' Return the number of words in a string
#'
#' @param x a string
#'
#' @return vector of numbers
#' @export
#'
#' @examples
#' syn_end <- syn("end")
#' syn_end_words <- n_words(syn_end)
#' syn_end[syn_end_words <= 1]
n_words <- function(x){
lengths(strsplit(x, " "))
}
You can’t perform that action at this time.