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

prop

Calculate proportion


Description

Calculate proportion

Usage

prop(x, na.rm = TRUE)

Arguments

x

Input variable

na.rm

If TRUE missing values are removed before calculation

Value

Proportion of first level for a factor and of the maximum value for numeric

Examples

prop(c(rep(1L, 10), rep(0L, 10)))
prop(c(rep(4, 10), rep(2, 10)))
prop(rep(0, 10))
prop(factor(c(rep("a", 20), rep("b", 10))))

radiant.data

Data Menu for Radiant: Business Analytics using R and Shiny

v1.3.12
AGPL-3 | file LICENSE
Authors
Vincent Nijs [aut, cre]
Initial release
2020-11-25

We don't support your browser anymore

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