Question

Ubuntu 12.10 x64, R 2.15.2

I'm at a loss, I've installed R numerous times and never had the slightest problem with the install. This time however when I launch the program (either by using the GUI or by typing "R" in the terminal) I get this;

cannot find system Renviron Error : .onLoad failed in loadNamespace() for 'utils', details: call: options(op.utils[toset]) error: invalid value for 'editor'

R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details.

Natural language support but running in an English locale

R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R.

Error : .onLoad failed in loadNamespace() for 'utils', details:
call: options(op.utils[toset]) error: invalid value for 'editor' In addition: Warning message: package "methods" in options("defaultPackages") was not found Error : .onLoad failed in loadNamespace() for 'utils', details: call: options(op.utils[toset]) error: invalid value for 'editor' In addition: Warning message: package ‘utils’ in options("defaultPackages") was not found Error : .onLoad failed in loadNamespace() for 'utils', details: call: options(op.utils[toset]) error: invalid value for 'editor' In addition: Warning message: package ‘stats’ in options("defaultPackages") was not found During startup - Warning message: package ‘methods’ in options("defaultPackages") was not found

Nothing works, no packages are found. I've never received any training on how to use Ubuntu, but from what I can gather I am missing the recommended packages for R.

I've tried completely removing R using both the Terminal as well as Synaptics Package Manager, then re-downloading the from CRAN servers (it seems to download too fast for my internet connection) and then reinstall. Same message. I'm at a loss.

Was it helpful?

Solution

I had the same problem and setting the EDITOR environment variable solved the problem for me.

Try e.g.

EDITOR=vim R

If that works, put the line

export EDITOR=vim

at the end of your ~/.profile

EDIT: the root of the problem was that /etc/R/Renviron was not read by R. As Dirk commented on his reply,

sudo chmod 644 /etc/R/Renviron

solves the problem

OTHER TIPS

The error seems to be the following :

error: invalid value for 'editor'

You can try to type the following in a terminal to know what the value of your EDITOR environment variable currently is :

echo $EDITOR

And maybe you should be able to start R from the command-line with something like :

EDITOR="" R

But it starts to get dicy before it gets to editor -- it seems like it fails to load your saved environment. Can you try

 R --no-restore-data

or even

 R --vanilla

Needless to say, it works for me and the only configuration change made was in the Java stack (see the Changelog file).

There is a dedicated list r-sig-debian for the Debian and Ubuntu packages where you'd get me (Debian packages), Johannes (Debian backports, available via CRAN) and Michael (Ubuntu builds, available via CRAN). I tend to run Michael's packages on my Ubuntu machines and have not had an issue.

I encountered this problems after I insall R and RStudio too.Both of them apear to have problems same as yours. I can't find the .Renviron in /etc/R.Then I search the Internet and find out I should use this file to set envirenments for my R. So all I need to do is new a ".Renviron" file and write it correctly. Fortunatelly I find a file named "Renviron.site" in /etc/R and inside it I find a few lines of comments :

   # ## Example .Renviron on Windows
   # R_LIBS=C:/R/library
   # MY_TCLTK="c:/Program Files/Tcl/bin"……

I suppose this would be useful to write my .Renviron file. So I write these in terminal:

sudo gedit /etc/R/.Renviron The .Renviron file is automatically created and open by gedit.Later on I copy

R_LIBS=~/R/library

PAGER=/usr/local/bin/less

R_DEFAULT_PACKAGES='utils,grDevices,graphics,stats'

into .Renviron file and save it.And the RStudio just work normally!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top