Published on

How to Fix: package ‘ggplot’ is not available for this version of R

Authors
  • avatar
    Name
    hwahyeon
    Twitter
package ‘ggplot’ is not available for this version of R

The ggplot package did exist in the past, but its last version was released in 2008. Because some older books or examples still use ggplot, you may encounter this error when studying with those materials.

Today, when people say they use “ggplot” in R, they usually do not mean the ggplot package itself. Instead, they are usually referring to the ggplot() function from the ggplot2 package created by Hadley Wickham.

Therefore, instead of writing:

install.packages("ggplot")
library("ggplot")

you can usually fix the issue by writing:

install.packages("ggplot2")
library(ggplot2)