Hi all my data looks like this
myDf = data.frame(SEX = as.factor(c(1,0,0,1,1)))
P <- ggplot(data = myDf, aes(x = SEX, fill = SEX)) +
geom_bar(stat = "count",show.legend = TRUE) +
stat_count(geom = "text", colour = "blue", size = 7,
aes(label = ..count..),position=position_stack(vjust=0.5))
P
when i do this i have got the x axis scale labels as 0 and 1. I want to change 0 to male and 1 to female on x axis, with out changing it in dataframe. Can someone help me with this ?
Thanks