Unsuccessful unpackaged "forecast" - r

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’

Related

How does one install rJava and qdap onto RLibrary?

I was working on an assignment that requires installing a number of packages (including rJava and qdap), and I was sucessful at that. But when I installed those projects onto RLibrary, I couldn't install Java and qdap.
I got the following errors:
> library(qdap)
Error: package or namespace load failed for 'qdap':
.onLoad failed in loadNamespace() for 'rJava', details:
call: dyn.load(jli, FALSE)
error: unable to load shared object '/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/jli/libjli.dylib':
dlopen(/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/jli/libjli.dylib, 0x000A): tried: '/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/jli/libjli.dylib' (mach-o file, but is an incompatible architecture (have (x86_64), need (arm64e)))
> library(rJava)
Error: package or namespace load failed for 'rJava':
.onLoad failed in loadNamespace() for 'rJava', details:
call: dyn.load(jli, FALSE)
error: unable to load shared object '/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/jli/libjli.dylib':
dlopen(/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/jli/libjli.dylib, 0x000A): tried: '/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/jli/libjli.dylib' (mach-o file, but is an incompatible architecture (have (x86_64), need (arm64e)))
I then tried to install Java, Java JDK, and pkgname, but got the following errors:
Warning in install.packages :
package 'Java JDK' is not available for this version of R
A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages
Warning in install.packages :
package 'pkgname' is not available for this version of R
A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages
I'm not sure why I am getting these errors. I'm using RStudio Version 2022.12.0+353 (2022.12.0+353), and MacOS Monterey 12.5.

Error: package or namespace load failed for ‘CGPfunctions’ [duplicate]

I am getting the following error when I am loading a few libraries in R:
library(forecast)
Error : object ‘f_eval’ is not exported by 'namespace:lazyeval'
In addition: Warning message:
package ‘forecast’ was built under R version 3.3.2
Error: package or namespace load failed for ‘forecast’
library(tsoutliers)
Error : object ‘f_eval’ is not exported by 'namespace:lazyeval'
In addition: Warning message:
package ‘tsoutliers’ was built under R version 3.3.2
Error: package or namespace load failed for ‘tsoutliers’
I have tried reinstalling the packages but it didn't help. Also, I was able to use the forecast package previously but I started facing this error post the installation of tsoutliers package.
How can I resolve this issue?
This should do the job for you:
install.packages('lazyeval')
In the future, try and provide a bit more about your system and install, using the output from:
sessionInfo()

rjags failed to load and R Failed to locate any version of JAGS

I am trying to use the package zoib and rjags. I have the latest version of R and have downloaded the latest version of JAGS as well.
Each time I install zoib and rjags it says it is successful but when I try to load them I get the following:
Error: package or namespace load failed for ‘rjags’:
.onLoad failed in loadNamespace() for 'rjags', details:
call: fun(libname, pkgname)
error: Failed to locate any version of JAGS version 4
Error: package ‘rjags’ could not be loaded
Is this a problem with the library from which R is loading packages from? Is this a version compatibility issue? Please help.

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 Package installation failed (needed for xlsx package)

When I want to install the xlsx package, I get this error :
Loading required package: rJava
Error : .onLoad failed in loadNamespace() for 'rJava', details:
call: fun(libname, pkgname)
error: JAVA_HOME cannot be determined from the Registry
In addition: Warning message:
package ‘rJava’ was built under R version 3.3.3
Error: package ‘rJava’ could not be loaded
So I tried reinstalling rJava, but I get this :
Error : .onLoad failed in loadNamespace() for 'rJava', details:
call: fun(libname, pkgname)
error: JAVA_HOME cannot be determined from the Registry
In addition: Warning message:
package ‘rJava’ was built under R version 3.3.3
Error: package or namespace load failed for ‘rJava’
Do you guys have any simple solution to this ? I am not very familiar with R, and I just need it to bootstrap some data.
I had the same error recently (R Error: JAVA_HOME cannot be determined from the Registry). I found the solution here. In brief, Joachim Schork identified the problem as not the xlsx package but rather the rjava package. He explained that the problem usually is, as hartmut said, running a 64 bit version of R and a 32 bit version of Java. To resolve the problem according to his recommendation, you need to download and install the 64 bit version of Java. In my case, the solution included installing Java on my machine as it was never installed previously.

Resources