Hi, I am new using R and stacked bar plots. I want to create a new categorical feature of adults for females and males combined and stack it with the infants to see the adult/infant proportion as a function of the ring number.
Here is the code I did.
#Code to create a bar plot.
abalone <- read_csv("abalone.csv")
Thanks for creating an Reproducible example and sharing the data. However to me it's not completely clear, what you actually want to do, want to count. Also in the provided data there is just a single occurrence per ring.
So I guess you just want to count the occurrences per Ring and Sex?
Thank you for your feedback and the plot looks better! I am trying to create a variable that includes Females and Males adults but not infants so in this way there will be only two variables (two colors) on the stacked barplot.