Hi, I could use help with configuring my R installation for spatial work. Because I was having difficulties to install spatial packages I used this set of instructions to help: https://rtask.thinkr.fr/installation-of-r-4-0-on-ubuntu-20-04-lts-and-tips-for-spatial-packages/
But I am still getting errors related to shared object files. I'd appreciate any insight into what may be the problem. (If you think it is better to post to the R stack exchange instead I can do that)
My system:
OS: Ubuntu 20.04 focal
Kernel: x86_64 Linux 5.4.0-66-generic
Uptime: 33m
Packages: 3542
Shell: bash 5.0.17
Resolution: 2560x1080
DE: KDE 5.68.0 / Plasma 5.18.5
WM: KWin
GTK Theme: Breeze [GTK2/3]
Icon Theme: breeze-dark
Disk: 1.2T / 1.9T (66%)
CPU: Intel Core i5-4460 @ 4x 3.4GHz [35.0°C]
GPU: GeForce GTX 1050 Ti
RAM: 3411MiB / 15954MiB
My R version:
R version 4.0.4 (2021-02-15) -- "Lost Library Book"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
My attempted command and resulting error:
> install.packages(c("tigris", "tidycensus"))
Installing packages into ‘/home/user/R/x86_64-pc-linux-gnu-library/4.0’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/tigris_1.0.tar.gz'
Content type 'application/x-gzip' length 262369 bytes (256 KB)
==================================================
downloaded 256 KB
trying URL 'https://cloud.r-project.org/src/contrib/tidycensus_0.11.4.tar.gz'
Content type 'application/x-gzip' length 1753003 bytes (1.7 MB)
==================================================
downloaded 1.7 MB
* installing *source* package ‘tigris’ ...
** package ‘tigris’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** byte-compile and prepare package for lazy loading
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/home/user/R/x86_64-pc-linux-gnu-library/4.0/rgdal/libs/rgdal.so':
libgdal.so.26: cannot open shared object file: No such file or directory
Calls: <Anonymous> ... namespaceImport -> loadNamespace -> library.dynam -> dyn.load
Execution halted
ERROR: lazy loading failed for package ‘tigris’
* removing ‘/home/user/R/x86_64-pc-linux-gnu-library/4.0/tigris’
Warning in install.packages :
installation of package ‘tigris’ had non-zero exit status
ERROR: dependency ‘tigris’ is not available for package ‘tidycensus’
* removing ‘/home/user/R/x86_64-pc-linux-gnu-library/4.0/tidycensus’
Warning in install.packages :
installation of package ‘tidycensus’ had non-zero exit status
The downloaded source packages are in
‘/tmp/Rtmp1UzoRP/downloaded_packages’
Warning in install.packages :
converting NULL pointer to R NULL