R ggplot2: stat_count() must not be used with a y aesthetic error in Bar graph

前端 未结 4 1359
[愿得一人]
[愿得一人] 2020-12-02 06:34

I am getting this error while plotting a bar graph and I am not able to get rid of it, I have tried both qplot and ggplot but still the same error.

Following is my c

4条回答
  •  一个人的身影
    2020-12-02 07:20

    I was looking for the same and this may also work

    p.Wages.all.A_MEAN <- Wages.all %>%
                      group_by(`Career Cluster`, Year)%>%
                      summarize(ANNUAL.MEAN.WAGE = mean(A_MEAN))
    

    names(p.Wages.all.A_MEAN) [1] "Career Cluster" "Year" "ANNUAL.MEAN.WAGE"

    p.Wages.all.a.mean <- ggplot(p.Wages.all.A_MEAN, aes(Year, ANNUAL.MEAN.WAGE , color= `Career Cluster`))+
                      geom_point(aes(col=`Career Cluster` ), pch=15, size=2.75, alpha=1.5/4)+
                      theme(axis.text.x = element_text(color="#993333",  size=10, angle=0)) #face="italic",
    p.Wages.all.a.mean
    

提交回复
热议问题