powered by
Count tokens by splitting strings
countTokens(str, split = "\t", ...)
A character string vector
Character used to split the strings
Other parameters passed to the strsplit function
strsplit
Integer vector: count of tokens in the strings
strsplit to split strings, or a convenient wrapper strtoken in this package.
strtoken
# NOT RUN { myStrings <- c("HSV\t1887\tFavorite", "FCB\t1900", "FCK\t1948") countTokens(myStrings) ## the function deals with factors as well countTokens(factor(myStrings)) # }
Run the code above in your browser using DataLab