npc: Print integers with percentage of total rounded to integer

Description Usage Arguments Examples

View source: R/print_percent.R

Description

Intended for succinctly printing summary data in a scientific publication.

Usage

1
npc(x, n, fmt = "%d (%s)")

Arguments

x

numeric number

n

numeric total

fmt

sprintf format, default being %d (%s)

Examples

1
2
3
4
5
6
npc(1, 100)
npc(1, 1)
npc(2, 1)
npc(1.321, 7.7432)
npc(7239, 234897)
npc(-10, 1000)

jackwasey/jwutil documentation built on Jan. 20, 2020, 6:56 p.m.