StringSet-class {Rlibstree} | R Documentation |
This is a class that represents a reference to a set of strings
in the libstree library. The underlying data structure can be thought
of as a character vector in which the order is not meaningful.
The set is a collection of strings. In R, we can
compute its length and index its elements via the
[
operator. This is convenient, for example,
when sampling from the set. However because the order is
not respected when constructing the set from a character
vector, one cannot treat this as a regular character vector in
R.
The preferred way to create a StringSet
is via the generic StringSet
function.
ref
:"externalptr"
. This is a reference
to the internal C-level object that represents the string set in libstree.
This external pointer has a tag value StringSet
.signature(x = "StringSet")
: ... signature(x = "StringSet", i = "numeric")
: ... signature(x = "StringSet", values = "character")
: ... signature(from = "StringSet", to = "character")
: ... signature(X = "StringSet", FUN = "function")
: ... signature(x = "StringSet")
: ... Duncan Temple Lang <duncan@wald.ucdavis.edu>
http://www.cl.cam.ac.uk/~cpk25/libstree/{libstree} http://www.omegahat.org/Rlibstree
words = c("stemming", "boing", "springs") set = StringSet(words) lapply(set, function(x) nchar) # Check that we can accept additional arguments lapply(set, substring, 1, 2)