I installed the new versions of RStudio (2022.07.1 Build 554) and R-4.2.1 for Windows. When installing the ggplot2 package I get an error message and although it looks installed, it does not run.
This is the error message:
Error: package or namespace load failed for ‘ggplot2’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]): there is no package called ‘gtable’
I try to install the gtable package, but I fail and it throws this message:
>install.packages("gtable", dependencies = TRUE)
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
https://cran.rstudio.com/bin/windows/Rtools/
There is a binary version available but the source version is later:
binary source needs_compilation
gtable 0.3.0 0.3.1 FALSE
installing the source package ‘gtable’
trying URL 'https://cran.rstudio.com/src/contrib/gtable_0.3.1.tar.gz'
Content type 'application/x-gzip' length 92733 bytes (90 KB)
downloaded 90 KB
Attaching package: 'dplyr'
The following objects are masked from 'package:base':
intersect, setdiff, setequal, union
Error: package or namespace load failed for 'ggplot2' in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]): there is no package called 'gtable'
Ejecución interrumpida
Warning in install.packages :
installation of package ‘gtable’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\camil\AppData\Local\Temp\RtmpSY9N5y\downloaded_packages’
> library(tidyverse)
Error: package or namespace load failed for ‘tidyverse’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
there is no package called ‘gtable’
Installation of the gtable package is failing, please post the complete console output you get when you run this command so we can try to identify the cause.
I installed the last version from https://cran.rstudio.com/bin/windows/base/R-4.2.1-win.exe. When selecting the path where to install RTools, I selected a path other than my operating system (C:/), which has more memory capacity. Everything else was default.
I reinstalled RTools and RStudio in C:/, but the problems continue. When I open RStudio, automatically send this message:
R version 4.2.1 (2022-06-23 ucrt) -- "Funny-Looking Kid"
Copyright (C) 2022 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
Attaching package: ‘dplyr’
The following objects are masked from ‘package:base’:
intersect, setdiff, setequal, union
Error: package or namespace load failed for ‘ggplot2’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
there is no package called ‘gtable’
Also it seems dplyr is being loaded on startup and that can cause this kind of problems, have you modified any . Rprofileor Rprofile.site file? Or are you restoring your previous environment on startup?
Thank you, I got confused. Now I installed it and restarted everything, but nothing has changed. I have not modified anything, I installed everything from scratch and started RStudio, installing ggplot and the error messages remain.
I would really appreciate your help, I've been at a standstill for hours without being able to move forward.
Check the content of C:\Program Files\R\R-4.2.1\etc\Rprofile.site and see if there is any command there that could be loading dplyr.
Look for any .Rprofile file located in your HOME folder (i.e. C:\Users\<< your user name>>\Documents), in your default working directory or in your current working directory and delete it (or rename it if you want to keep the content).