问题描述
我正在尝试对ggplot中的列进行重新排序,以从最小到最大,但始终收到此错误消息
countries<-c("Australia","Austria","Belgium","Canada","Denmark","France","Germany","Italy","Luxembourg","Netherlands","norway","New Zealand","Spain","Sweden","United Kingdom","USA")
cost<-c(1221,711,184,250,6658,51,1118,880,919,2500,1558,2452,103,920,1460,401)
citcost<-data.frame(countries,cost)
citcost %>% ggplot(citcost,aes(x=reorder(countries,cost),y=cost,fill=countries)) + geom_bar(stat="identity") + theme(axis.text.x = element_text(angle = 45,hjust = 1)) + scale_colour_brewer()
错误:应该使用aes() or
aes _()`创建映射。