qplot绘制条形图,报错Error in `f()`:

问题遇到的现象和发生背景

hello~

学习R数据可视化手册时,按照教程代码绘制条形图时,报错!

qplot(BOD$Time, BOD$demand, geom='bar', stat='identity')
运行结果及报错内容
qplot(BOD$Time, BOD$demand, geom = 'bar', stat = 'identity')
Error in `f()`:
! stat_count() can only have an x or y aesthetic.
Run `rlang::last_error()` to see where the error occurred.
Warning message:
`stat` is deprecated 

它的报错内容我不太能理解,因为我并没有f()函数,其次我确实只提供了一个x与一个y。希望有志之士能帮我解答一下

我尝试了使用以下代码,绘制结果如下。但是我觉得这和上诉的代码时相同意思。

ggplot(BOD, aes(x=Time, y=demand)) + geom_bar(stat='identity') 

img

谢谢
祝好~