Skip to contents

Append Suffix to (Selected) Character Values

Usage

appendSuffix(values, suffix, valuesToOmit = NULL)

Arguments

values

vector of character values to which suffix is to be appended

suffix

(character) suffix to be pasted to values that are not in valuesToOmit

valuesToOmit

vector of values in values to which no suffix is to be appended

Value

values with suffix appended to those values that are not in valuesToOmit

Examples

values <- c("a", "b", "c")
  
# Append ".1" to all values
appendSuffix(values, ".1")
#> [1] "a.1" "b.1" "c.1"
  
# Append ".1" to all values but "c"
appendSuffix(values, ".1", valuesToOmit = "c")
#> [1] "a.1" "b.1" "c"