% Generated by roxygen2: do not edit by hand % Please edit documentation in R/explore.R \name{prop} \alias{prop} \title{Calculate proportion} \usage{ prop(x, na.rm = TRUE) } \arguments{ \item{x}{Input variable} \item{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 } \description{ Calculate proportion } \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)))) }