nPctBin01 | R Documentation |
Absolute and relative frequencies of 1's in a binary 0-1 variable.
nPctBin01(x, digits = 1)
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. |
Number and percent of 1's in a numeric vector x which contains only 1's and 0's.
nPctBin01(rbinom(100,1,0.4))
nPctBin01(sample(c(0,1),50,replace=TRUE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.