Created
January 16, 2013 08:26
-
-
Save nassimhaddad/4545526 to your computer and use it in GitHub Desktop.
function that counts the number of words (= delimited by " ") in a string.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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