Hello!

I am working with questionnaire data. I have a data list (an Excel file that I have imported in RStudio with function "read_excel") where columns are the questions and each individual's answer makes one row. One of the questions is "diagnosis" (options a, b and c), and another "treatment" (options x, y, z and w). I would like to create a new table that represents distribution of the treatment option based on diagnosis (where each diagnosis group makes one row, and the column names are x, y, z and w, and the table values indicate how many in the diagnosis group have received a specific treatment). Could someone please help me how to do that in RStudio?