Karl Brand
2011-Sep-07 08:54 UTC
[R] How does one start R within Emacs/ESS with root privileges?
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. 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 -- Karl Brand <k.brand at erasmusmc.nl> Department of Genetics Erasmus MC Dr Molewaterplein 50 3015 GE Rotterdam P +31 (0)10 704 3455 | F +31 (0)10 704 4743 | M +31 (0)642 777 268
Paul Hiemstra
2011-Sep-07 09:02 UTC
[R] How does one start R within Emacs/ESS with root privileges?
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, Paul> > 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 http://intamap.geo.uu.nl/~paul http://nl.linkedin.com/pub/paul-hiemstra/20/30b/770
Karl Brand
2011-Sep-09 16:19 UTC
[R] How does one start R within Emacs/ESS with root privileges?
Thanks a lot for sharing your experience and suggestions. I see now the logic of making use of my user library which doesn't require root privs. Apparently linux is actually set up to work well - something i'm not used to from the other OS i've used till now. And for the rare times i do need to install into the system-wide library, i think i'll survive in the terminal :P cheers, Karl On 2011-09-07 17:08, Spencer Graves wrote:> Under Vista and Windows 7, I install R in a local directory "pgms" so I > never have to worry about permissions. > > > Under Linux, I use "su" not "sudo". Then I call R and install.packages. > Then I quit R and "su" and continue with what I want. > > > hope this helps. > Spencer > > > On 9/7/2011 5:11 AM, Karl Brand wrote: >> Cheers Paul. >> >> Its a very good point. Although i am curious how badly i can damage my >> R install by running as root. I always ran R in windows with admin. >> privileges without problems (touch wood). Probably best to never find >> out by sticking with user privileges. >> >> However, even for taking care of R install/maint. i'd prefer to do >> this interactively within Emacs rather than the terminal. Motivated by >> this, i'd still like to find out how to invoke R with root privileges. >> >> I've also reposted the original email on perhaps a more appropriate >> forum at: ESS-help at stat.math.ethz.ch >> >> Karl >> >> >> On 2011-09-07 11:02, Paul Hiemstra wrote: >>> 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, >>> Paul >>> >>>> >>>> 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 >>>> >> >-- Karl Brand <k.brand at erasmusmc.nl> Department of Genetics Erasmus MC Dr Molewaterplein 50 3015 GE Rotterdam P +31 (0)10 704 3455 | F +31 (0)10 704 4743 | M +31 (0)642 777 268