cross_count: count two columns as a cross-tabulation table

View source: R/dataframe.R

cross_countR Documentation

count two columns as a cross-tabulation table

Description

count two columns as a cross-tabulation table

Usage

cross_count(df, row, col, method = "n", digits = 2)

Arguments

df

tibble

row

the column as rownames in the output

col

the column as colnames in the output

method

one of ⁠n|count, rowr|row_ratio, colr|col_ratio⁠

digits

the digits of ratios

Value

data.frame

Examples

cross_count(mini_diamond, cut, clarity)

# show the ratio in the row
cross_count(mini_diamond, cut, clarity, method = "rowr")

# show the ratio in the col
cross_count(mini_diamond, cut, clarity, method = "colr")


baizer documentation built on Oct. 19, 2023, 9:07 a.m.