Error in loading packages RcmrdMisc and tidyverse in R - r

I am having trouble with loading some packages in the R environment.
The following error message pops up for package RcmdrMisc
Loading required package: car
Loading required package: carData
Loading required package: sandwich
Error: package or namespace load failed for ‘RcmdrMisc’:
.onLoad failed in loadNamespace() for 'checkmate', details:
call: NULL
error: package ‘backports’ does not have a namespace
Also, I am getting a similar error for package tidyverse
Error: package or namespace load failed for ‘tidyverse’:
.onLoad failed in loadNamespace() for 'broom', details:
call: NULL
error: package ‘backports’ does not have a namespace
I have tried uninstalling the packages and reinstalling them. But the error persists.
I have installed dependencies for the respective packages.
I have downloaded the latest available updates for both R and RStudio, but to no avail.
What am I doing wrong? Is there any fix for this issue?

Related

Problems loading two libraries

I am trying to install the libraries plotKML and spatialEco in a standard way, with library().
However, despiste I updated R, updated all my libraries, and tried reinstalling them, I keep getting the next errors:
> library(plotKML)
plotKML version 0.6-1 (2020-03-08)
Error: package or namespace load failed for ‘plotKML’:
.onAttach failed in attachNamespace() for 'plotKML', details:
call: CRS("+init=epsg:4326")
error: NA
In addition: Warning message:
package ‘plotKML’ was built under R version 4.0.3
> library(spatialEco)
Error: package or namespace load failed for ‘spatialEco’:
.onLoad failed in loadNamespace() for 'units', details:
call: udunits_init(file.path(.get_ud_xml_dir(), "udunits2.xml"))
error: Error in function udunits_init: Can't open installed, default, unit database
In addition: Warning message:
package ‘spatialEco’ was built under R version 4.0.3
How can I solve it?

‘rJava’ could not be loaded after installing R version 3.4

Loading required package: xml2
Loading required package: rJava
Loading required package: methods
Error: package or namespace load failed for ‘rJava’:
.onLoad failed in loadNamespace() for 'rJava', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object
'/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava/libs/rJava.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava/libs/rJava.so, 6): Library not loaded: #rpath/libjvm.dylib
Referenced from: /Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava/libs/r Java.so
Reason: image not found
Error: package ‘rJava’ could not be loaded
Execution halted
I'm getting this error a day after I installed version 3.4 of R. I tried solutions from other pages but it didn't work. I can't run R scripts through the terminal but I run scripts on RStudio. I'm thinking that it might be a problem with paths, but I just wanted to double check here and confirm instead of getting myself into a deeper mess.

Unsuccessful unpackaged "forecast"

I have tried many times to install the package "forecast", but always unsuccessfully. I have the newest version of R.
The strange thing is that the package is successfully unpacked, but the load (through the Library) doesn't work.
This is the error:
Error : .onLoad failed in loadNamespace() for 'Rcpp', details:
call: new_dummyObject(.dummyInstancePointer)
error: object 'class__dummyInstance' not found
In addition:
Warning message:
package ‘forecast’ was built under R version 3.1.3
Error: package or namespace load failed for ‘forecast’

not able to use rJava after installing the package successfully

I am not able to use rJava after installing the package successfully.
library("rJava") Error : .onLoad failed in loadNamespace() for 'rJava', details: call: dirname(this$RuntimeLib) error: a character vector argument expected Error: package or namespace load failed for ‘rJava’

ggplot2 package failing to load

I just recently updated my Rstudio to the 0.98.1103 release and now I'm unable to load ggplot it keeps throwing the following error. Any ideas what is going on?
> library(ggplot2)
Error : .onLoad failed in loadNamespace() for 'tcltk', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.1/Resources/library/tcltk/libs/tcltk.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.1/Resources/library/tcltk/libs/tcltk.so, 10): Library not loaded: /usr/X11/lib/libXft.2.dylib
Referenced from: /usr/local/lib/libtk8.6.dylib
Reason: image not found
Error: package or namespace load failed for ‘ggplot2
I tried removing the tcltk library and ggplot2 and reinstalling them now I'm getting a different set of errors:
> library(ggplot2)
Error : package ‘tcltk’ does not have a namespace
Error: package or namespace load failed for ‘ggplot2’
> library(tcltk)
Error in library(tcltk) : ‘tcltk’ is not a valid installed package
Seems like X11 is not installed on your system. Try installing xorg (if you're running Linux) or XQuartz if you're on OSX.

Resources