I got the following Two-way contingency table with cell percentages along with frequencies (in parentheses).
gender blue blue-gray brown dark hazel yellow
female 33.33% (3) 0.00% (0) 55.56% (5) 0.00% (0) 11.11% (1) 0.00% (0)
male 34.62% (9) 3.85% (1) 46.15% (12) 3.85% (1) 3.85% (1) 7.69% (2)
The R
code I used is
library(dplyr)
library(janitor)
starwars %>%
filter(species == "Human") %>%
tabyl(gender, eye_color) %>%
adorn_percentages("row") %>%
adorn_pct_formatting(digits = 2) %>%
adorn_ns()
However, I want to get the same kind of table with cell frequencies along with percentages (in parentheses). Any help, please.