R 3.5.2 - ggplot error

Hello guys,

I need to know something about "ggplot" .

ggplot(df, aes(price, y = ..density..)) +
geom_freqpoly(aes(colour = cut), binwidth = 500)

Error in ggplot(df, aes(price, y = ..density..)) :
could not find function "ggplot"

When I try to install ggplot, there is an error for R 5.3.2 :

Warning in install.packages :
package ‘ggplot’ is not available (for R version 3.5.2)

So how can I edit my recently code?

Sincerely,
Alp

The package is called ggplot2 (note the "2"). It has a function named ggplot. In order to install it, you need to run

install.packages("ggplot2")

You need to do that just once on your computer. Then, whenever you want to use it, you need to load it in your session with

library(ggplot2)

Then you can use the ggplot() function and friends.

2 Likes

Thank you so much, I noticed now! I was thinking the ggplot is a old package of ggplot2 :no_mouth:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.