make_scale_regex: Build conceptual scale based on pattern matching

Description Usage Arguments Value Examples

Description

Build conceptual scale based on pattern matching

Usage

1

Arguments

objs

Vector (usually character or factor).

patterns

Character vector of regular expressions. Each attribute of the resulting context amounts to grepl(x = objs, pattern = pattern) for some pattern in patterns.

split

Character. Regular expression used to split objs into patterns, if patterns is not provided.

Value

A binary matrix (formal context).

Examples

1
2
3
4
5
6
# state name modifiers
make_scale_regex(objs = state.name,
                 patterns = c("^New", "^(North|South|East|West)"))

# letters in state names
make_scale_regex(objs = state.abb, split = "")

corybrunson/context documentation built on May 13, 2019, 10:52 p.m.