numform (version 0.5.0)

f_affix: Add String Affixes

Description

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

Usage

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

Run this code
# NOT RUN {
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("$")
# }

Run the code above in your browser using DataLab