Free Access Week - Data Engineering + BI
Data Engineering and BI courses are free this week!
Free Access Week - Jun 2-8

baizer (version 0.8.0)

cross_count: 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)

Value

data.frame

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

Examples

Run this code
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")

Run the code above in your browser using DataLab