powered by
Use prop.table() to add a proportion column to a dplyr::count() tibble.
prop.table()
dplyr::count()
add_prop(.data, n, sum = FALSE)
A data frame with the new column p.
p
A data frame with a count column.
The column name with a count, usually n from dplyr::count().
n
Should cumsum() be called on the new p column.
cumsum()
mean(x %in% y)
add_prop(dplyr::count(ggplot2::diamonds, cut))
Run the code above in your browser using DataLab