spec2props: Convert a Properties Specification Character Scalar or Vector...

View source: R/ppp.R

spec2propsR Documentation

Convert a Properties Specification Character Scalar or Vector to a Character Vector of Single Properties

Description

Splits each element of x along both | and ⁠_⁠ to create a character vector of single constituent properties, removes any blank values, reduces the result to unique values, converts all remaining values to lowercase, and sorts the remaining values.

Usage

spec2props(x)

Arguments

x

A character vector

Value

Either NULL or a non-empty character vector of unique, sorted, lowercase, 3-character values.

Returns NULL if any of the following criteria are met:

  • x is not of mode 'character'.

  • Any resulting value is NA.

  • Any resulting value is not a 3-character string.

  • x resolves to a zero-length character vector.

See Also

Other utils: check_valid(), combo2props(), meets_errs(), spec2combos(), stack2funs()


j-martineau/uj documentation built on Sept. 14, 2024, 4:40 a.m.