segment.string | R Documentation |
Split strings into their constituent segments (and count them).
segment.string(x, split = NULL)
segment.counts(x, split = NULL)
x |
one or more strings to be split (and, optionally, counted) |
split |
the boundary character or sequence at which to segment the
string(s). The default, |
segment.string()
: Returns a list (of the same length as x
), each item a vector of
character vectors.
segment.counts()
: Calculate the frequency of individual characters in one or more strings.
Returns a matrix with one row for every string in x
.
segment.string(c("asd", "fghj"))
segment.string(c("la-dee-da", "lala-la"), "-")
segment.counts(c("asd", "aasd", "asdf"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.