Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error when running library(ggplot2)

Tags:

r

ggplot2

I just updated to R 2.11.1 and after installing ggplot2, I tried

library(ggplot2) 

and got

Loading required package: proto Loading required package: grid Loading required package: reshape Loading required package: plyr Loading required package: digest Error in eval(expr, envir, enclos) : could not find function "proto" In addition: Warning message: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :   there is no package called 'proto' Error : unable to load R code in package 'ggplot2' Error: package/namespace load failed for 'ggplot2' 

Any help appreciated.

like image 472
Peter Flom Avatar asked Jun 28 '10 16:06

Peter Flom


People also ask

Why is Ggplot not working in R?

3 if you see Error in ggplot(...) : could not find function "ggplot" , it means that the ggplot() function is not accessible because the package that contains the function ( ggplot2 ) was not loaded with library(ggplot2) . Thus you cannot use the ggplot() function without the ggplot2 package being loaded first.

Why ggplot2 is not installing in Rstudio?

Your error message is telling you that ggplot2 is not being installed because rlang is not being installed correctly. If this fails it may be because you do not have the necessary tools to build R packages from source.

What does error in Ggplot mean?

One error you may encounter in R is: Error in ggplot(df, aes(x = x, y = y)) : could not find function "ggplot" This error occurs when you attempt to create a plot using the ggplot2 data visualization package, but have failed to load the package first.

What does library ggplot2 do in R?

Overview. ggplot2 is a system for declaratively creating graphics, based on The Grammar of Graphics. You provide the data, tell ggplot2 how to map variables to aesthetics, what graphical primitives to use, and it takes care of the details.


2 Answers

install.packages('ggplot2', dep = TRUE) would do the trick... install proto package

like image 76
aL3xa Avatar answered Sep 28 '22 19:09

aL3xa


Open R shell and type following in it

install.packages('ggplot2', dep = TRUE) 

then it will ask you to select the mirror, select closest one and it will install it and solve your problem.

like image 43
Hafiz Muhammad Shafiq Avatar answered Sep 28 '22 20:09

Hafiz Muhammad Shafiq