title: R ggplot2 functions do not work
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/7027288/error-could-not-find-function-in-r">Error: could not find function &hellip; in R</a>  </p>
  </blockquote>
  
  
  
  <h1>Question: why do my ggplot2 functions not work?</h1>
  
  <ul>
  <li><p>Background: Ubuntu 12.04, Gnome Desktop, R 2.15.1, Mirror: <a href="http://cran.stat.ucla.edu/" rel="nofollow noreferrer">http://cran.stat.ucla.edu/</a></p></li>
  <li><p>First of all, it says downloaded source packages are in '/tmp/Rtmp2GMNV8/downloaded_packages.' THERE IS NO '/tmp/Rtmp2GMNV8/downloaded_packages.'</p></li>
  <li><p>Second, ggplot2 is installed. Why then "could not find function "qplot""???</p></li>
  </ul>
  
  <p>I've looked for hours and cannot find any answers online. Does anybody know what is going on?</p>
  
  <p>The readout:</p>
  
  <pre><code>emilio@dog:~/R$ sudo R
  
  R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows"
  
  # I've taken the liberty of omitting a few lines
  
  &gt; install.packages("ggplot2", dependencies=TRUE)
  Installing package(s) into ‘/usr/local/lib/R/site-library’
  [...]
  * DONE (SparseM)
  * DONE (sp)
  * DONE (mvtnorm)
  * DONE (evaluate)
  * DONE (Hmisc)
  * DONE (maps)
  * DONE (hexbin)
  * DONE (gpclib)
  
  * installing *source* package ‘ggplot2’ ...
  ** package ‘ggplot2’ successfully unpacked and MD5 sums checked
  ** R
  ** data
  **  moving datasets to lazyload DB
  ** inst
  ** preparing package for lazy loading
  ** help
  *** installing help indices
  ** building package indices
  ** testing if installed package can be loaded
  
  * DONE (ggplot2)
  * DONE (quantreg)
  * DONE (mapproj)
  * DONE (maptools)
  * DONE (multcomp)
  * DONE (testthat)
  
  The downloaded source packages are in
      ‘/tmp/Rtmp2GMNV8/downloaded_packages’
  &gt; help(qplot)
  No documentation for ‘qplot’ in specified packages and libraries:
  you could try ‘??qplot’
  &gt; help(ggplot)
  No documentation for ‘ggplot’ in specified packages and libraries:
  you could try ‘??ggplot’
  &gt; data(diamonds, package="ggplot2")
  &gt; head(diamonds)
    carat       cut color clarity depth table price    x    y    z
  1  0.23     Ideal     E     SI2  61.5    55   326 3.95 3.98 2.43
  2  0.21   Premium     E     SI1  59.8    61   326 3.89 3.84 2.31
  3  0.23      Good     E     VS1  56.9    65   327 4.05 4.07 2.31
  4  0.29   Premium     I     VS2  62.4    58   334 4.20 4.23 2.63
  5  0.31      Good     J     SI2  63.3    58   335 4.34 4.35 2.75
  6  0.24 Very Good     J    VVS2  62.8    57   336 3.94 3.96 2.48
  &gt; qplot(carat, price, data = diamonds)
  Error: could not find function "qplot"
  
  emilio@dog:~$ cd /tmp/Rtmp2GMNV8/downloaded_packages
  bash: cd: /tmp/Rtmp2GMNV8/downloaded_packages: No such file or directory
  </code></pre>