32
votes

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"

1
I don't know where you found a copy of ggplot, since it's no longer available on CRAN. ggplot2 has completely replaced it. - Andrie
I would reopen. I think gsk's answer is probably the right one and its definitely a FAQ even if it's not in the FAQ. - IRTFM
@DWin: yes it is, see FAQ 7.30 ... - Ben Bolker
@DWin : it is the right answer, so no more answers needed. These kind of questions best disappear into oblivion. - Joris Meys
@Joris Meys: I guess you changed your mind on that point? (Since you posted a basically an identical question later.) - IRTFM

1 Answers

57
votes

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