Failing to load rgdal package in R - r

I'm having trouble loading rgdal in RStudio. I tried the usual command install.packages and when prompted with
"Do you want to install from sources the package which needs compilation (Yes/no/cancel)"
I've tried both yes and no. However I continue to get a cryptic error message when I try to load the library for use. It is:
Error: package or namespace load failed for ‘rgdal’ in dyn.load(file, DLLpath = >DLLpath, ...):
unable to load shared object >'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/rgdal/libs/rgdal.so':
dlopen(/Library/Frameworks/R.framework/Versions/4.0/Resources/library/rgdal/libs/rgdal.so, 6): Symbol not found: _sqlite3_column_table_name
Referenced from: /Library/Frameworks/R.framework/Versions/4.0/Resources/library/rgdal/libs/rgdal.so (which was built for Mac OS X 10.13)
Expected in: /usr/lib/libsqlite3.dylib
in /Library/Frameworks/R.framework/Versions/4.0/Resources/library/rgdal/libs/rgdal.so

Related

Error in installing R package asreml on mac

I'm not too familiar with R and are using it for Uni, and we need this asreml package for one of our classes. When I try installing it this error comes up:
Error: package or namespace load failed for ‘asreml’:
.onLoad failed in loadNamespace() for 'asreml', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/00LOCK-asreml/00new/asreml/libs/libvsninet.so':
dlopen(/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/00LOCK-asreml/00new/asreml/libs/libvsninet.so, 0x0006): tried: '/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/00LOCK-asreml/00new/asreml/libs/libvsninet.so' (mach-o file, but is an incompatible architecture (have (x86_64), need (arm64e)))
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/asreml’
Warning in install.packages :
installation of package ‘/Users/Cami/Downloads/asreml-4.1.0.176-macOS-10.13.2-R4.2.tar.gz’ had non-zero exit status
I tried installing it on R both with a full path to the file and with a working directory set up. I've also tried to install it directly through the computer terminal, however, the same error comes up. A tutor in class has also tried to open a library for the package through the terminal on my laptop and it also didn't work. Neither of us are sure of what 'libvsninet.so' means. I've also tried to disinstall and reinstall both R and RStudio, but the result is the same.

R Fails to Library Packages

I am having trouble on getting R to library packages to use tools such as ggplot. I have reinstalled R to try and remedy the issue to no avail. Currently I can install packages normally install.packages(ggplot2) I am later given the potentially key message
Installing package into ‘/Users/jet/Library/R/arm64/4.1/library’
(as ‘lib’ is unspecified)
Installation returns to normal and I select my CRAN mirror and am left with
The downloaded binary packages are in
/var/folders/1w/nbtkj1314rnbdv3djd0vm7zw0000gn/T//RtmpOkNNTZ/downloaded_packages
Later when I try and library the packageslibrary(ggplot) I receive the following error.
Error: package or namespace load failed for ‘ggplot2’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/Users/jet/Library/R/arm64/4.1/library/colorspace/libs/colorspace.so':
dlopen(/Users/jet/Library/R/arm64/4.1/library/colorspace/libs/colorspace.so, 0x0006): Library not loaded: /opt/homebrew/opt/r/lib/R/lib/libR.dylib
Referenced from: /Users/jet/Library/R/arm64/4.1/library/colorspace/libs/colorspace.so
Reason: tried: '/opt/homebrew/opt/r/lib/R/lib/libR.dylib' (no such file), '/usr/local/lib/libR.dylib' (no such file), '/usr/lib/libR.dylib' (no such file)
What should I do to resolve this issue?

Unable to load R package gsl: libgsl.so.25: cannot open shared object file: No such file or directory

My R version is 4.1.2. It seems that I successfully install gsl package, but when I run library(gsl), I get following error:
Error: package or namespace load failed for ‘energy’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/public/home/username/localR/lib64/R/library/gsl/libs/gsl.so':
libgsl.so.25: cannot open shared object file: No such file or directory
Only this package has the error above. Meanwhile, when I try to use the packages related to it(e.x. energy), R will occur the same error. However, other packages are not affected.
Thanks.

Why does installed "igraph" package return "libicui18n.so.58: cannot open shared object file"after loading?

I was trying to install the package igraph in R using the command install.packages("igraph"). After the installation, during testing phase it showed the following error:
testing if installed package can be loaded Error: package or namespace
load failed for ‘igraph’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object
'/home/midhun/R/x86_64-redhat-linux-gnu-library/3.5/igraph/libs/igraph.so':
libicui18n.so.58: cannot open shared object file: No such file or
directory Error: loading failed Execution halted ERROR: loading
failed
removing ‘/home/midhun/R/x86_64-redhat-linux-gnu-library/3.5/igraph’
The downloaded source packages are in
‘/tmp/RtmpLVDism/downloaded_packages’ Warning message: In
install.packages("igraph") : installation of package ‘igraph’ had
non-zero exit status
Why this is happening? What could be a solution?
The library igraph requires library files such as:
libicui18n.so.58, libicuuc.so.58, libgfortran, etc.
These were either not installed in the proper library folder or were existing as previous versions. For example, in my case, libicuuc.so.58 was required to be installed in usr/lib64. Make sure that dependencies are installed correctly to solve such problems.

RStudio Server Can't Find 'GLIBCXX_3.4.20'

I've got a server running RStudio, and recently another user updated what version of gcc was on it for another project. I attempted to install Rcpp, and get the following error:
Error: package or namespace load failed for ‘Rcpp’ in dyn.load(file,
DLLpath = DLLpath, ...): unable to load shared object
'/home/username/R/x86_64-redhat-linux-gnu-library/3.5/Rcpp/libs/Rcpp.so':
/lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by
/home/username/R/x86_64-redhat-linux-gnu-library/3.5/Rcpp/libs/Rcpp.so)
Error: loading failed Execution halted ERROR: loading failed
Oddly, this doesn't occur when using R from the command line, which makes me think that RStudio Server is having trouble finding GLIBCXX_3.4.20, rather than it being genuinely missing.
Does anyone know how to sort this error out?

Resources