abbrevWords: Abbreviates StoX project names.

Description Usage Arguments Examples

Description

Abbreviates StoX project names.

Usage

1
2
abbrevWords(x, p = 1/2, collapse = "_", keep = c("capital",
  "numeric", "punct"), sub = 0, abbrev = TRUE)

Arguments

x

A vector of strings.

p

The exponent in the abbreviation function. The number of characters remaining (n) after possibly capital letters and numbers have been fixed in the abbreviated string, are reduced in number according to round(n^p).

collapse

The character to separate words by.

keep

Keywords for what to keep in the abbreviated strings. Including "punct" ensures that punctuation characters are left untouched, but still considered as separators between words.

sub

A value to add to the number of characters in a single abbreviated word. Set this to say -1 to remove wery whort words such as "in".

Examples

1
2
3
4
5
cs <- getNMDinfo("cs", recursive = FALSE)
sts <- getNMDinfo("sts", recursive = FALSE)
abbr <- list(cbind(cs, abbrevWords(cs)), cbind(sts, abbrevWords(sts)))
abbr
lapply(abbr, nchar)

Sea2Data/Rstox documentation built on May 14, 2019, 8:58 a.m.