countTokens: Count tokens by splitting strings

Description Usage Arguments Value Author(s) See Also Examples

View source: R/string.R

Description

Count tokens by splitting strings

Usage

1

Arguments

str

A character string vector

split

Character used to split the strings

...

Other parameters passed to the strsplit function

Value

Integer vector: count of tokens in the strings

Author(s)

Jitao David Zhang <jitao_david.zhang@roche.com>

See Also

strsplit to split strings, or a convenient wrapper strtoken in this package.

Examples

1
2
3
4
5
myStrings <- c("HSV\t1887\tFavorite", "FCB\t1900", "FCK\t1948")
countTokens(myStrings)

## the function deals with factors as well
countTokens(factor(myStrings))

ribiosUtils documentation built on March 13, 2020, 2:54 a.m.