ggplot barplot z legendą
ggplot(a2, aes(x = cntry, y = mean_stflife, fill = factor(gndr))) +
geom_bar(stat="identity", position=position_dodge()) + scale_fill_manual(values = c("1" = "#6666CC",
"2" = "#CC6699")) + xlab("countries") + ylab("mean life satisfaction") + ggtitle("Plot 1. Mean staisfaction with life among differnet countries")
Diana H