nPctBin01: Absolute and relative frequencies of 1's in a binary 0-1...

View source: R/funciones.R

nPctBin01R Documentation

Absolute and relative frequencies of 1's in a binary 0-1 variable.

Description

Absolute and relative frequencies of 1's in a binary 0-1 variable.

Usage

nPctBin01(x, digits = 1)

Arguments

x

A vector of numeric values containing only 1's and 0's. Function returns an error if there are other values in x.

digits

Number of decimal digits for showing relative frequency.

Value

Number and percent of 1's in a numeric vector x which contains only 1's and 0's.

Examples

nPctBin01(rbinom(100,1,0.4))
nPctBin01(sample(c(0,1),50,replace=TRUE))

angeloSdP/reportingTools documentation built on Dec. 25, 2024, 11:19 a.m.