library not loading in R - r

library("forecast")
Error : .onAttach failed in attachNamespace() for 'forecast', details:
call: fun(libname, pkgname)
error: 4 arguments passed to .Internal(nchar) which requires 3
In addition: Warning message:
package ‘forecast’ was built under R version 3.2.2
Error: package or namespace load failed for ‘forecast’

Related

Can't run R on Mac

I'm trying to download R on my mac. I have Big Sur and a M1 chip.
During startup - Warning messages:
1: package ‘utils’ in options("defaultPackages") was not found
2: package ‘stats’ in options("defaultPackages") was not found
Error : .onLoad failed in loadNamespace() for 'utils', details:
call: switch(os, Linux = if (file.exists("/etc/os-release")) {
error: EXPR must be a length 1 vector

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?

Can't load the mailR package in R

I would like to load mailR package in both my local rStudio and one run off an ec2 server. I get this error:
> require(mailR)
Loading required package: mailR
Error : .onLoad failed in loadNamespace() for 'rJava', details:
call: fun(libname, pkgname)
error: No CurrentVersion entry in Software/JavaSoft registry! Try re-installing Java and make sure R and Java have matching architectures.
In addition: Warning message:
package ‘mailR’ was built under R version 3.3.3
If I try to load rJava I get:
> require(rJava)
Loading required package: rJava
Error : .onLoad failed in loadNamespace() for 'rJava', details:
call: fun(libname, pkgname)
error: No CurrentVersion entry in Software/JavaSoft registry! Try re-installing Java and make sure R and Java have matching architectures.
In addition: Warning message:
package ‘rJava’ was built under R version 3.3.2
Thank you for the help!

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’

Resources