optform
optform

Reputation: 1057

Using ggplot function in R error : could not find function ggplot

I have installed ggplot and ggplot2 and their dependencies, but I cannot use the function ggplot; whenever I try to use it I get

Error in ggplot ... could not find function "ggplot"

Upvotes: 34

Views: 81858

Answers (1)

Ari B. Friedman
Ari B. Friedman

Reputation: 72731

Try:

library(ggplot2)

Even after installing a package, you have to load a package each time you load R.

This question is answered comprehensively in the r-faq:

Error: could not find function ... in R

Upvotes: 57

Related Questions