impossible to find the function "ggplot" - r

I am having problems with ggplot, getting the above error message.See full error message below after running library(ggplot2):
Error: package or namespace load failed for 'ggplot2' in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
'vctrs' package 0.3.6 is already loaded, but >= 0.3.8 is required
Also: Warning message:
package 'ggplot2' was compiled with R 4.0.5
I have tried removing the package and then reinstalling it with dependencies. Nothing seems to work. The error seems to have been triggered when I tried to do an install of the ggflags package from Github, the package info states that it is a ggplot extension. Please give me an idea of how to fix this because I use ggplot for all data viz in R

Try the following shotgun-approach, as I suspect you are missing relevant packages,
# remove packages
remove.packages("tidyverse")
# reinstall
install.packages("tidyverse", dependencies = TRUE)
If this does not work, you should post your sessionInfo() in your post.

Related

Failure in installing packages

I have written my code a-2 months ago and i try to reuse it, but the installation of packages fails and i become this warning:
install.packages("devtools")
library("devtools")
> library("devtools")
Loading required package: usethis
Error: package or namespace load failed for ‘usethis’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
namespace ‘cli’ 3.3.0 is already loaded, but >= 3.4.0 is required
Error: package ‘usethis’ could not be loaded
Although i reinstalled RStudio and R, tried to upadte all packages and install all their dependencies etc, it fails to install the updates/packages. Do you have any idea? Thank you in advance.
first you need to check from bottom right (Packages) and search for devtools if you found check if installed or not, also you can write ?devtools to see if help page show up for Package development tools for R, if you want to use the package you can write devtools:: and follow it with the name of function.

Issue installing Hmisc in Rstudio and calling in the library

I've had the following error for the package Hmisc. I read another thread which asked more about the error message however it said not to post this as a comment. I've installed the package and received the following error when calling in the library:
> library(Hmisc)
Error: package or namespace load failed for ‘Hmisc’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
there is no package called ‘checkmate’
In addition: Warning message:
package ‘Hmisc’ was built under R version 3.4.4
I've tried deleting the install and then installing checkmate separately and manually installing this from a browser rather than through R directly. However the same error message is returning. Does anyone know how to overcome this? Or similar packages to Hmisc. I need to package for a wtd.quantile function.
install.packages('lattice')
library('lattice')
install.packages('survival')
library('survival')
install.packages('Formula')
library('Formula')
install.packages('ggplot2')
library('ggplot2')
install.packages('checkmate')
library('checkmate')
install.packages('htmlwidgets')
library('htmlwidgets')
install.packages('stringi')
library('stringi')
install.packages('Hmisc')
library('Hmisc')

Error message when installing ggplot2

I have been trying to install ggplot2 but get the following error:
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
namespace ‘scales’ 0.4.0 is being loaded, but >= 0.4.1 is required
ERROR: lazy loading failed for package ‘ggplot2’
* removing ‘/Library/Frameworks/R.framework/Versions/3.2/Resources/library/ggplot2’
Just so you know, I am using RStudio 1.0.136 and R 3.2.1 GUI Snow Leopard. Could it be a problem of compatibility with the old version of R that I am using? Does anyone know what the above means?
install.packages("scales")
install.packages("ggplot2")
will do the trick. Also try to keep your packages in R updated in the future, since R packages usually depend on the latest versions of other packages.
if you are on windows try :
install.packages("ggplot2", type="win.binary",dependencies = TRUE) else check the documentation in type and binary packages sections for the correct type according to your os :
https://www.rdocumentation.org/packages/utils/versions/3.5.2/topics/install.packages

Error while loading ggplot2 package

I get the following error when I try to load ggplot2. I tried to uninstall scales and reinstall it but for some reason R can't find the package when I want to remove the package...
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
namespace ‘scales’ 0.2.5 is already loaded, but >= 0.3.0 is required
In addition: Warning message:
package ‘ggplot2’ was built under R version 3.2.3
Error: package or namespace load failed for ‘ggplot2’
I had the same problem, I just install again ggplot2 and everything worked again. It installed also scales 0.4.2, so it solved the problem by itself.

Error Code with ggplot in R

I have uninstalled R and Rstudio. When I originally downloaded Rstudio the package was not listed in the packages section, so I downloaded and imported the zip file. There is no current version of R that is 3.3.0 that I can find-- my R version is 3.2.2. I have tried to install using the RGui as admin and I get the same error.
This is my error:
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck =
vI[[i]]) : there is no package called ‘gtable’ In addition: Warning
message: package ‘ggplot2’ was built under R version 3.3.0 Error:
package or namespace load failed for ‘ggplot2’
You are somehow executing R 3.3.0. No matter, though, you can simply invoke install.packages('ggplot2', repos='http://cran.rstudio.com', type='source') should sort you. If not, post a comment.

Resources