Npct: Combine count with a percent

Description Usage Arguments Value Methods (by class) Examples

View source: R/Npct.R

Description

Combine count with a percent

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
Npct(x, n, ...)

## S4 method for signature 'logical,missing'
Npct(x, n, ...)

## S4 method for signature 'logical,logical'
Npct(x, n, ...)

## S4 method for signature 'integer,integer'
Npct(x, n, ...)

## S4 method for signature 'numeric,numeric'
Npct(x, n, ...)

Arguments

x

count or object to count

n

see methods.

...

formatting arguments for formatting the percent. See format.percent.

Value

A character vector formatted with number and percent of successes.

Methods (by class)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Vector of cases only.
Npct(c(TRUE, FALSE, TRUE))

# Cases with indices
Npct( c(TRUE,FALSE,TRUE,FALSE,TRUE), c(TRUE,TRUE,TRUE,FALSE,FALSE))

# Successes/Total
Npct(2L, 3L)

# Count + percent directly, count must be integerish.
Npct(2, 2/3)

cursory documentation built on Aug. 22, 2019, 9:03 a.m.