r语言 - 我在 Rstudio 中找不到意外错误



嗨,我找不到的错误所在

g1<-ggplot()+geom_bar(data=ventas2,aes(x=time,y=values,fill=mot_nrg),stat="identity",width=.6)+scale_fill_manual(breaks=c("DIE","PET"),values=c("#EB9486","#9ED8DB","blue"))+scale_y_continuous(breaks=brks,labels=lbls)+coord_flip()+labs(title="Engine Consumption")+theme(plot.title = element_text(hjust=.5)),axisTicks(element_blank())+geom_text(data=ventas2,aes(label=abs(values),x=time,y=values),fontface="bold")+geom_line(data=ventas2,aes(x=time,y=values,group=1,size=0.7,linetype="dashed")+geom_point(data=ventas2,aes(x=time,y=values),color="#2374AB",show.legend = FALSE)+theme(text=element_text(size=16,family="American Typewriter",face="bold"),plot.title = element_text(size=20,family="serif",hjust=0.5),legend.position = "bottom")
**Error: inesperado ',' in "lues,fill=mot_nrg),stat="identity",width=.6)+scale_fill_manual(breaks=c("DIE","PET"),values=c("#EB9486","#9ED8DB","blue"))+scale_y_continuous(breaks=brks,labels=lbls)+coord_flip()+labs(title=""**

请注意

我想您这里缺少了一个括号:

geom_line(data=ventas2,aes(x=time,y=values,group=1,size=0.7,linetype="dashed")+

geom_line应该有两个结束括号,而我只能看到一个。

提示:在你的RStudio中,按每个结尾的回车+符号,它会自动缩进你的代码;(

最新更新