I have seen the question already asked... and solved adding stat = \"identity\" to geom_bar. But in my case, this does not solve anything (I still
stat = \"identity\"
geom_bar
the error was because the geom_line() or geom_point() option was not added. You can directly plot it without saving it as object on adding this option.