Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

fmt_n

Formatted Count


Description

A function to calculate and format a numeric count.

Usage

fmt_n(x)

Arguments

x

The input data vector or data frame column.

Details

This function calculates a count using the Base R sum function. NA values are not counted. Results are returned as a character vector.

Value

The formatted count value.

See Also

Examples

# Create example vector
v1 <- c(4.3, 3.7, 8.7, 6.1, 9.2, 5.6, NA, 0.7, 7.8, 4.9)

# Format n
fmt_n(v1)

# Output
# "9"

fmtr

Easily Apply Formats to Data

v1.5.0
CC0
Authors
David Bosak
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.