0
dort platziert werden. Also, das ist mein Code:Wie Labels/Frequenzen über geom_bar r in R mit ggplot2
library(ggplot2); library(scales); library(reshape2);
da1 <- read.table(text = "NÃO SIM
5 1
24 44
",sep = "",header = TRUE)
da1m <- melt(cbind(da1, ind = rownames(da1)), id.vars = c('ind'))
da1m$Resposta <- c("NÃO", "SIM", "NÃO", "SIM")
names(da1m) <- c("Resposta", "variable", "value")
ggplot(da1m,aes(x = variable, y = value,fill = Resposta)) +
geom_bar(position = "fill",stat = "identity", colour = "black") +
scale_y_continuous(labels = percent_format())+
labs(title = "Gráfico 1", x="Gosta de utilizar o R",
y="Há interessse em aprimorar os conhecimentos em R")+
scale_fill_manual(values=c("#E69F00", "#56B4E9"))+
geom_text(aes(label=value), position=position_dodge(width=0.9),
vjust=-0.5)
Und das ist, was ich bekommen:
Was mache ich falsch? Das Diagramm beginnt seltsamerweise auch in Funktion der geom_text
, wenn ich versuche, die Frequenzen hinzuzufügen.
Hallo! Vielen Dank! Ich weiß noch nicht viel über ggplot, das war sehr hilfreich :) –