I have a data set where I need to stack barplot for each exam which relative frequncy(in %) and actual number of frequency, but I can figure out how to modify tha data set into that,
I am giving a short data set for instance

What I want for a particular ethnicity, I want relative frequency(in %) and actual number of frequency for each exam(one stack bar for exam 1, one stack bar for exam2 and so on) in r. I am having difficulties how can I do that, I got an example https://www.r-graph-gallery.com/48-grouped-barplot-with-ggplot2.html here, but it's basically that made up the example, but how can I convert my data into this way to do the stack bar plot. I understand that I have to made a count variable, but don't know exactly how?