ExtractNames: Extract the root name of compound variable names

Description Usage Arguments Value Examples

View source: R/ExtractNames.R

Description

ExtractNames returns a character vector with the root names of the input parameter.

This function is thought to be applied on those variable names with suffixes containing underscores (_) and qualifier values. It takes as input parameter NamesVector a character vector with the names of possibly several variables and extracts their root names dropping out every suffix. The returned variable root names must have an exact correspondence with the variable names (column "Variable") of class DD.

Usage

1
ExtractNames(NamesVector)

Arguments

NamesVector

Character vector with the original compound variable names.

Value

Character vector of the same length as the input parameter NamesVector with the corresponding root names of each variable name.

Examples

1
2
3
4
5
ExtractNames(c('ICMCifraNeg', 'ICMEmpleo_1.', 'ICMEmpleo_2.1', 'ICMEmpleo_2.2'))
ExtractNames(c('IASSCifraNeg.x', 'IASSCifraNeg.y'))
ExtractNames(c('ICMCifraNeg.x', 'ICMEmpleo_1..x', 'ICMEmpleo_2.1.x', 'ICMEmpleo_2.2.x',
               'ICMCifraNeg.y', 'ICMEmpleo_1..y', 'ICMEmpleo_2.1.y', 'ICMEmpleo_2.2.y'))
               

david-salgado/StQ documentation built on Aug. 12, 2021, 3:23 p.m.