grapes-hasPrefix-grapes: Check if a string starts with another string.

Description Usage Arguments Details Value See Also Examples

Description

Within soundcorrs, primarily intended to extract rows and columns from contingency tables. Other than that, of general applicability.

Usage

1
x %hasPrefix% prefix

Arguments

x

[character] The string or strings in which to look.

prefix

[character] The string to look for. May be a regular expression.

Details

Contingency tables, such as produced by coocc and summary, can get quite sizeable and therefore difficult to read with larger datasets. Since both their column and row names are composed from individual segments connected by an underscore ("_"), %hasPrefix% offers an easy way to select the interesting bit of the table by the first segment.

Value

[logical] TRUE iff x begins with prefix.

See Also

%hasSuffix%

Examples

1
2
"loans.tsv" %hasPrefix% "loans"
c("abc","bbc","cbc") %hasPrefix% "[bc]"

soundcorrs documentation built on Nov. 16, 2020, 5:09 p.m.