How to put a label in categorical data

I want to put a label on the table but I don't know how.

gender <- ggplot(data = StudentsPerformance) +
geom_bar(mapping = aes(StudentsPerformance$gender), fill=colortable$gendercolor) +
labs(title = "Gender of the Respondents",
x = "Gender") +
theme(plot.title = element_text(hjust = 0.5)) +
theme_bw() +
theme(panel.grid.major = element_blank(),
panel.grid.minor = element_blank())


It's not clear what you want to label, but check these examples:

Thank you for replying! I wanted to put the number of females and males at the top of the table or inside the table.

In that case check the examples towards the bottom of this page:

1 Like

Got it! Thank you so much :smiling_face_with_three_hearts:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.