Trouble installing ggplot

2,190 views
Skip to first unread message

Mark_Ravina

unread,
Feb 16, 2011, 1:51:56 PM2/16/11
to ggplot2
Apologies for the newbie question, but I get an error message for all
ggplot objects such as "Error: could not find function
"geom_histogram" Basic R is fine

I've run "install.packages("ggplot2")," and
"install.packages('ggplot2', dep = TRUE)", and selected different CRAN
mirrors, but I still can't find the functions.

I'm running R 2.12.1 GUI 1.35 Leopard build 32-bit (5665) under OSX
10.6.6

Thanks

Joshua Wiley

unread,
Feb 16, 2011, 2:10:02 PM2/16/11
to Mark_Ravina, ggplot2
Hi Mark,

After installing ggplot2, did you load the package? Typically this is
required each time you start a new R session:

require(ggplot2) # loads package
geom_histogram # show histogram function

If you did load the package (either using require() or
library()---they are basically equivalent), then it might help us if
you report the output of:

sessionInfo()

Cheers,

Josh

> --
> You received this message because you are subscribed to the ggplot2 mailing list.
> Please provide a reproducible example: http://gist.github.com/270442
>
> To post: email ggp...@googlegroups.com
> To unsubscribe: email ggplot2+u...@googlegroups.com
> More options: http://groups.google.com/group/ggplot2
>

--
Joshua Wiley
Ph.D. Student, Health Psychology
University of California, Los Angeles
http://www.joshuawiley.com/

Brandon Hurr

unread,
Feb 16, 2011, 2:10:45 PM2/16/11
to Mark_Ravina, ggplot2
Are you loading the packages before trying to use them. 

For example if I start up a fresh R session... 
R version 2.12.0 (2010-10-15)
Copyright (C) 2010 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)
[SNIP]
[R.app GUI 1.35 (5632) x86_64-apple-darwin9.8.0]

> qplot(1:10, 1:10)
Error: could not find function "qplot"

But if I load them first... 

> library(ggplot2)
Loading required package: reshape
Loading required package: plyr

Attaching package: 'reshape'

The following object(s) are masked from 'package:plyr':

    round_any

Loading required package: grid
Loading required package: proto
> qplot(1:10, 1:10)

I get a simple graph. 

If it's not quite that newbie, if you go into your Packages & Data, Package Installer: 
CRAN Binaries, Get List, then scroll down to ggplot2 and see if it's installed correctly. 

Brandon


Ista Zahn

unread,
Feb 16, 2011, 2:08:42 PM2/16/11
to Mark_Ravina, ggplot2
Did you load it?

library(ggplot2)

Best,
Ista

> --
> You received this message because you are subscribed to the ggplot2 mailing list.
> Please provide a reproducible example: http://gist.github.com/270442
>
> To post: email ggp...@googlegroups.com
> To unsubscribe: email ggplot2+u...@googlegroups.com
> More options: http://groups.google.com/group/ggplot2
>

--
Ista Zahn
Graduate student
University of Rochester
Department of Clinical and Social Psychology
http://yourpsyche.org

Reply all
Reply to author
Forward
0 new messages