add_prop {campfin} | R Documentation |
Add proportions
Description
Use prop.table()
to add a proportion column to a dplyr::count()
tibble.
Usage
add_prop(.data, n, sum = FALSE)
Arguments
.data |
A data frame with a count column. |
n |
The column name with a count, usually |
sum |
Should |
Details
mean(x %in% y)
Value
A data frame with the new column p
.
Examples
add_prop(dplyr::count(ggplot2::diamonds, cut))
[Package campfin version 1.0.11 Index]