rstatix package installation - r

I´m having problems with the "rstatix" package installation. When the installation finishes and I try to run the library, I get this message:
Error: package or namespace load failed for ‘rstatix’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
namespace ‘vctrs’ 0.2.0 is being loaded, but >= 0.3.2 is required
In addition: Warning message:
package ‘rstatix’ was built under R version 3.6.3
Have any of you dealt with this problem before? How did you solve it? Thanks!

I think the "vctrs" package should be >= 0.3.2. Try to update the "vctrs" package to the latest one.
# below is the command to update the package
install.packages("vctrs")
# if you want to update all packages
update.packages()
After this try to import your package.

Related

Why do I get this error when loading library tidyverse?

Yesterday I loaded tidyverse` as usual, but not I get the following error:
library(tidyverse)
Warning: package ‘tidyverse’ was built under R version 4.1.3Error: package or namespace load failed for ‘tidyverse’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]): namespace ‘cli’ 3.1.0 is already loaded, but >= 3.4.1 is required
I already updated my packages.
Also, I have tried the following:
remove.packages("tidyverse")
install.packages("tidyverse")
remove.packages("rlang")
install.packages("rlang")
But again, when I load library(tidverse) I get the same error.
At the end, I updated my R version (to 4.2.2) and changed it to RStudio manually: Tools -> Global Options -> R version.

Loading Packages in R

library(ggplot2)
Error: package or namespace load failed for ‘ggplot2’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘vctrs’
In addition: Warning message:
package ‘ggplot2’ was built under R version 3.6.3
library(dplyr)
Error: package or namespace load failed for ‘dplyr’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘vctrs’
In addition: Warning message:
package ‘dplyr’ was built under R version 3.6.3
I just looked up at Cran, whether vctrs 0.3.4 exists and it looks like version 0.3.4 only exists for macOS. As I can see from the URL you have posted in the comments you're using the OS Windows. And for Windows only vctrs 0.3.3 exists.
So my suggestion (little bit ugly but well...): Download the zip-src of vctrs 0.3.3 manually and then you can choose in RStudio to install from the zip file you've downloaded.
Or my other suggestion you can use: install.packages.zip("zip-url-manually-copied"), for more look: https://rdrr.io/cran/installr/man/install.packages.zip.html.
Have a good day!
I got solved, I need to upgrade my R. Previously I am using version 3.6.0 and now I upgraded to 4.0.2, after upgrade everything works fine.

"Forecast" package in R couldn't be executed

Previously, I had used this same package with the very same data. Today, I installed couple of neural network package in R. I noticed that after installing the new package, I can no longer execute the "forecast" package. There is some package missing, which I had re-install again. And the last one, I had this warning message. Is there anyone had any idea what it was?
library(forecast)
Error: package or namespace load failed for ‘forecast’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
namespace ‘pkgconfig’ 2.0.1 is being loaded, but >= 2.0.2 is required
In addition: Warning message:
package ‘forecast’ was built under R version 3.4.4
I had try to re-install the "forecast" package but still I got some error message. Thank you so much in advance.
By #andresrcs(Sustainer)
Jul 6
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
namespace ‘pkgconfig’ 2.0.1 is being loaded, but >= 2.0.2 is required
This is telling you that you have to update this package dependency, try installing it first with
install.packages("pkgconfig")
If everything goes well, then you can try to install ggplot2 again, but this time try with this command
install.packages("ggplot2", dependencies = TRUE)

Why am I getting an error while trying to load caret package?

I tried:
library(caret)
then I got the error:
Loading required package: ggplot2
Error: package or namespace load failed for ‘ggplot2’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
namespace ‘rlang’ 0.3.0.1 is already loaded, but >= 0.3.1 is required
Error: package ‘ggplot2’ could not be loaded
In addition: Warning message:
package ‘ggplot2’ was built under R version 3.5.3
so I tried updating the ggplot2 using:
install.package("ggplot")
even after that I am getting the same error. my caret package is also updated.
I think you can try two things. One is updating your R version (and Rstudio version?). The other can be updating ggplot2 with dependencies:
install.packages('ggplot2', dependencies = TRUE)

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.

Resources