Last answered:

07 Dec 2022

Posted on:

28 Oct 2021

0

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?

3 answers ( 0 marked as helpful)
Instructor
Posted on:

28 Oct 2021

0

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

Posted on:

10 Nov 2021

0

still not working

Posted on:

07 Dec 2022

0

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"

Submit an answer