cant find GGplot2 error keeps happening
I have been getting the error
Error in ggplot2(df_used_cars, aes(x = Brand, y = Cars.Listings)) :
could not find function "ggplot2"
I have installed ggplot2 and the package is "ticked" in the packages panel.
I have looked around online but no solution seems to be working...
anyone have any ideas?
Hi Connor,
thanks for reaching out!
The library we use is called ggplot2, however the function name is just ggplot(), without the 2, I believe that's why you're getting the error.
So, when you're importing the library(ggplot2)
you need the 2, but when plotting a ggplot function, the syntax is ggplot()
, without the 2.
Hope this helps!
Best,
365 Eli
still not working
I went to Tools -> Install Packages and installed ggplot2.
It still can't find ggplot or ggplot2 functions:
Error in ggplot(df_used_cars, aes(x = Brand, y = Cars.Listings)) :
could not find function "ggplot"
Error in ggplot2(df_used_cars, aes(x = Brand, y = Cars.Listings)) :
could not find function "ggplot2"
Error in ggplot2.ggplot(df_used_cars, aes(x = Brand, y = Cars.Listings)) :
could not find function "ggplot2.ggplot"