does anyone have any tips on how to install rgdal in Ubuntu 22.04? i tried install.packages() and i tried with sudo apt, but no luck.
I am new to Linux/Ubuntu and absolutely at my wits' end (and regretting moving to Ubuntu!)
#r #rstudo #rgdal #dataviz #datavis #ubuntu

@stingh

I would suggest using @eddelbuettel r2u project to keep all your R packages fresh in Ubuntu, including {rgdal}. I am using it on the laptop I use for teaching/presentations and works great.

Details at: https://eddelbuettel.github.io/r2u/

After you've set up your system, it is just a quick:

$ sudo apt install r-cran-rgdal

CRAN as Ubuntu Binaries - r2u

Easy, fast, reliable -- pick all three!

@jmcastagnetto @stingh

Thanks for the endorsement!

And thanks to the 'magic' of `bspm` you can do the same from #Rstats which may be an easier transition for those new to `apt`:

Rscript -e 'install.packages("rgdal")'

will also take care of `rgdal`, all its R dependencies *and* all their system dependencies. All as binaries. Automagically.

#r2u: Fast. Easy. Reliable. Pick all three.

@eddelbuettel @jmcastagnetto @stingh Automagically *if* you run that as sudo, yes? And if you run install.packages(...) as a normal user what happens? The normal failings?

@geospacedman @jmcastagnetto @stingh

Just try it and see:

docker run --rm -ti rocker/r2u Rscript -e 'install.packages("tidyverse")'

@eddelbuettel @jmcastagnetto @stingh that runs as a privileged user though, I was wondering about the utility of it in a multi-user system, or the possibility of a user breaking their R libraries or an install failing by doing install.packages as an unpriv user.

@geospacedman @jmcastagnetto @stingh It is a good and somewhat open question (maybe make it an issue?). I am using it on a server for students but I think _there_ I will hide the bspm and r2u aspect (for use by the admins incl me) so that the students will _first_ install into their local ~/R/ directory.

In short I still think we can mix and match. r2u will cover the basic few hundred packages and make updates easy.