segment.string: Split strings into their constituent segments.

View source: R/dists.R

segment.stringR Documentation

Split strings into their constituent segments.

Description

Split strings into their constituent segments (and count them).

Usage

segment.string(x, split = NULL)

segment.counts(x, split = NULL)

Arguments

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, NULL, splits the string after every character.

Functions

  • 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.

Examples

segment.string(c("asd", "fghj"))

segment.string(c("la-dee-da", "lala-la"), "-")
segment.counts(c("asd", "aasd", "asdf"))

kevinstadler/cultevo documentation built on Jan. 13, 2024, 11:22 p.m.