[R-sig-Debian] installing tydiverse on Linux Mint

Ivan Krylov kry|ov@r00t @end|ng |rom gm@||@com
Wed Jan 3 09:36:55 CET 2024

On Tue, 02 Jan 2024 22:38:25 -0500
Luben Dimov <luben.dimov using gmail.com> wrote:

> And then I tried running this in the Linux Mint terminal, with and
> without sudo:
> download.file("https://github.com/eddelbuettel/r2u/raw/master/inst/scripts/add_cranapt_jammy.sh
> ",
>               "add_cranapt_jammy.sh")

> bash: syntax error near unexpected token `('
> bash: syntax error near unexpected token `)'

download.file(...) is an R expression, so it should be typed into R,
not the Linux Mint terminal. The Linux Mint terminal is running a
command line interpreter called "bash". You can distinguish the input
intended for the two by looking for the brackets. In R, everything is a
function call, and R needs a pair of brackets to call a function; bash
only uses them to delimit subshell expressions, so they are much rarer.

It should be possible to download a file in the bash command prompt
using wget followed by the URL in quotes or curl -O followed by the URL
in quotes.

The Debian Administrator's Handbook
<https://debian-handbook.info/browse/stable/> is a free e-book that
explains some of the tasks related to administering your installation
of Mint (which is a Debian derivative and so should be compatible) in
more detail. In particular, see the appendix B.1 and chapter 6.

Ten Steps to Linux Survival by J. Lehmer
<https://github.com/dullroar/ten-steps-to-linux-survival/> is also free;
this one will actually tell you how to download a file from the command
line using curl or wget and mentions sudo in multiple places.

(It would be entirely valid to ask yourself at this point, why does it
take two books to accomplish something as simple as installing a bunch
of R packages without compiling everything from source, a solved
problem over in the land of R for Windows? I blame the leaky
abstractions and the fragmented ecosystem.)

Best regards,

More information about the R-SIG-Debian mailing list