[英]Names in geom_bar with ggplot2
I need some help with this graph, here's my code 我需要这张图的帮助,这是我的代码
ggplot(aes(x=situa_ence,fill=cs_sexo), data=dados) +
geom_bar(aes(y = (..count..)/sum(..count..)))
I need to put names in each bar 我需要在每个栏中加上名称
(1 =Sick, 2 = Not sick ) (1 =生病,2 =未生病)
使用ifelse()
dados$situa_ence <- ifelse(dados$situa_ence == 1, yes = "Sick", no = "Not sick")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.