HandleStrings: Handle names and factors' levels

HandleStringsR Documentation

Handle names and factors' levels

Description

Internal functions dedicated to solve strings or factors related simple tasks

Usage

handleNamesSubsets(names, subset = vector(mode = "character"))

conditionsFromNames(names, splitPattern = " ", fragmentNum = 2L)

isEmptyName(name)

niceFactorLevels(v)

factorToVector(f)

Arguments

names

The full list of the names to handle

subset

The names' subset. When empty all names are returned instead!

splitPattern

the pattern to use to split the names

fragmentNum

the string fragment to use as condition from the split names

name

the name to check

v

an array or factor object

f

a factor object

Details

handleNamesSubsets() returns the given subset or the full list of names if none were specified

conditionsFromNames() retrieves a condition from the given names by picking the asked fragment after having them split according to the given pattern

isEmptyName() returns whether the passed name is not null and has non-zero characters

niceFactorLevels() provides nicer factor labels that have all the same number of characters

factorToVector() converts a named factor to a named ⁠character vector⁠

Value

handleNamesSubsets() returns the updated list of names' subset, reordered according to the given names' list

conditionsFromNames() returns the extracted conditions

isEmptyName() returns whether the passed name is equivalent to an empty string

niceFactorLevels() returns a factor that is preserving the names of the input with the new nicer levels

factorToVector() returns a ⁠character vector⁠ that preserves the names of the input factor


seriph78/COTAN documentation built on Dec. 10, 2024, 3:30 a.m.