2
I have a data-frame with the structure below. I want to make a simple bar graph that relates the "CID" by type (A, B, C, etc...) with the days of departure and the other with the Calls.
df <- data.frame(CID = c("A", "A", "B", "C", "C", "Z"),
AFASTAMENTOS = c(2,3,5,8,9, 12),
ATENDIMENTOS = c(21, 32, 4, 6, 7, 43),
stringAsfactors = FALSE )
I tried with ggplot2, making the CID variable a factor:
ggplot(df, aes(CID, y = AFASTAMENTOS)) + geom_bar()
Who called me back: Error: stat_count() must not be used with a y Aesthetic.
Thank you very much,
Your code, unfortunately, is not reproducible. Would you please provide a part of this data frame? If you know English, the stackoverflow gringo has a very good text on how to make a minimally reproducible post: http://stackoverflow.com/a/5963610/1027912
– Marcus Nunes