[R] How does one start R within Emacs/ESS with root privileges?

Paul Hiemstra paul.hiemstra at knmi.nl
Wed Sep 7 11:02:23 CEST 2011

 On 09/07/2011 08:54 AM, Karl Brand wrote:
> Esteemed UseRs and DevelopeRs,
> Apologies if this question belongs else where, but it does concern R's
> package installation/maintenance.
> How does one start R within Emacs/ESS with root privileges?
> I tried without success:
> > M-x sudo R
> Why i'm motivated to do so:
> It seems logical to me, as the only user of the PC, to keep my R
> library consolidated in the universal library rather than splitting
> into universal and user libraries. Hence the desire to run R as root.

Hi Karl,

Why the need to install packages in root? As you are the only user there
is not reason to install them system wide (to make them available to all
users, which is just you). Installing the packages in your homedir
solves your problem much easier, without the need to run R as root
continuously. I think you should not run anything as root if it is not
absolutely needed, which could potentially damage your system
(accidentally overwriting something).

hope this helps,

> In addition, it's nice to be able to install packages 'on the fly'
> when and as needed and not need to launch a separate R session (as
> root) in the terminal just to install a package.
> Migrating from windows, i'm completey new to linux (ubuntu) and am
> seeing for myself if Emacs/ESS is as good as its purported to be. So
> maybe my motivation is nonsensical to expereinced ESS/R users. If so
> i'd really appreciate tips on efficient package
> installation/maintenance using Emacs/ESS.
> TIA,
> karl

Paul Hiemstra, Ph.D.
Global Climate Division
Royal Netherlands Meteorological Institute (KNMI)
Wilhelminalaan 10 | 3732 GK | De Bilt | Kamer B 3.39
P.O. Box 201 | 3730 AE | De Bilt
tel: +31 30 2206 494


More information about the R-help mailing list