names2Codes: Generate short codes from long names

Description Usage Arguments Value See Also Examples

View source: R/coinToolIn.R

Description

Given a character vector of long names (probably with spaces), generates short codes. Intended for use when importing from the COIN Tool.

Usage

1
names2Codes(cvec, maxword = 2, maxlet = 4)

Arguments

cvec

A character vector of names

maxword

The maximum number of words to use in building a short name (default 2)

maxlet

The number of letters to take from each word (default 4)

Value

A corresponding character vector, but with short codes, and no duplicates.

See Also

Examples

1
2
# generate codes for indicators in the ASEM data set (first five only)
names2Codes(ASEMIndMeta$IndName[1:5], maxlet = 3)

COINr documentation built on Nov. 30, 2021, 9:06 a.m.