Learn R Programming

numform (version 0.6.4)

f_sign: Format Numeric Signs

Description

f_sign - Formats numeric values to just their sign ('-' == < 0, '+' == > 0, or '' == 0).

Usage

f_sign(x, positive = "+", negative = "-", zero = "", ...)

ff_sign(...)

Arguments

x

A vector of values.

positive

A string/value to insert in for positive values.

negative

A string/value to insert in for negative values.

zero

A string/value to insert in for zero values.

ignored.

Value

Returns a string of signs.

See Also

f_num

Examples

Run this code
# NOT RUN {
f_sign(c(-10, 0, 10))
f_sign(c(-10, 0, 10), zero = 0)
## web based
f_sign(c(-10, 0, 10), '<b>+</b>', '<b>–</b>')
# }

Run the code above in your browser using DataLab