Skip to content

Instantly share code, notes, and snippets.

@nassimhaddad
Created January 16, 2013 08:26
Show Gist options
  • Save nassimhaddad/4545526 to your computer and use it in GitHub Desktop.
Save nassimhaddad/4545526 to your computer and use it in GitHub Desktop.
function that counts the number of words (= delimited by " ") in a string.
get_word_count <- function(string){
length(unlist(strsplit(as.character(string), " ")))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment