f_affix: Add String Affixes

Description Usage Arguments Value Examples

View source: R/f_affix.R

Description

Convenience function to add affixes to strings (prefixes & suffixes).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
f_affix(x, prefix = "", suffix = "", ...)

ff_affix(...)

f_prefix(x, prefix = "$", ...)

ff_prefix(...)

f_suffix(x, suffix = "%", ...)

ff_suffix(...)

Arguments

x

A vector of elements to append with an affix.

prefix

A string to append to the front of elements.

suffix

A string to append to the back of elements.

...

ignored.

Value

Returns a string of affix appended digits.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
f_affix(1:5, "-", "%")
f_affix(f_num(1:5, 2), "-", "%")

f_prefix(LETTERS[1:5], "_")
f_prefix(f_bills(123456789123, -2), "$")

f_suffix(LETTERS[1:5], "_")
f_suffix(f_num(1:5, 2), "%")

## Not run: 
f_bills(123456789123, -2) %>%
    f_prefix("$")

## End(Not run)

numform documentation built on Oct. 10, 2021, 1:10 a.m.