ggplot2 line chart gives “geom_path: Each group consist of only one observation. Do you need to adjust the group aesthetic?”
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: With this data frame ("df"): year pollution 1 1999 346.82000 2 2002 134.30882 3 2005 130.43038 4 2008 88.27546 I try to create a line chart like this: plot5 <- ggplot ( df , aes ( year , pollution )) + geom_point () + geom_line () + labs ( x = "Year" , y = "Particulate matter emissions (tons)" , title = "Motor vehicle emissions in Baltimore" ) The error I get is: geom_path: Each group consist of only one observation. Do you need to adjust the group aesthetic? The chart appears as a scatter plot even though I want a line chart. I