[R] How do I create tables with sub columns?

I need to create a table with summary statistics on a data frame, and I want to group 4 similar columns (N_cases, percent) into 2 broader columns (incident, prevalent), so it would look like this:

| Prevalent | Incident |
|    N | %  |   N | %  |
3 points · 0 comments · view on lemmy.world

0 Comments

actionjbone@sh.itjust.works · 1 pts · 148d
[ removed ]