[ESS] Re : Re: Re : Re : Re: Re : Re: R-versions

"Gérald Jean" gerald.jean at videotron.ca
Tue Oct 28 18:03:36 CET 2014


Hello,

I am a little ashamed to admit it, but after well over 10 years of work under Unix / Linux I had never used symlinks before. I did as suggested by Vitalie and Martin, got rid of all the messing around with the Linux PATH and/or Emacs exec-path variables and ESS found all versions of R pointed to by the symlinks and, of course, the version installed by admin in the regular location.

Thanks to both of you and I have the feeling it's not the last time I'm using symlinks!!!

Gérald

Le 27/10/14, Vitalie Spinu  <spinuvit at gmail.com> a écrit :
> 
> 
> The problem seems to be that both of your Rs are named R. So ESS will
> pick only one of them. It looks like older path in exec-path takes
> precedence. In that case it's a bug.
> 
> As mentioned earlier in this thread, in order to get all your R's
> detected you simply need to simlink them to ~/bin:
> 
>  ln -s /actuaria/application/ess_app/RevolutionR/bin/R ~/bin/R-3-revo
>  ln -s /actuaria/application/terr/terr21/bin/R ~/bin/R-3-terr
>  ln -s /actuaria/application/ess_app/R-patched/bin/R ~/bin/R-patched
> 
> No exec-path hackery is necessary.
> 
>  Vitalie
> 
> 
>  >>> "Gérald Jean" on Mon, 27 Oct 2014 10:46:12 -0400 wrote:
> 
>  > Hello Martin,
>  > thanks again for your explanations. I am back to work this morning and trying to understand what is going on.
> 
>  > "/usr/bin" is in my PATH, calling "echo $PATH" either directly from the shell or from Emacs' shell yields the same result and "/usr/bin" is included. It is also included in the Emacs' exec-path variable.
> 
>  > Starting R either from the native shell or from Emacs' shell starts the latest installed R version, i.e. 3.1.1
> 
>  > Without the line:
> 
>  > (setq inferior-R-program-name "/usr/bin/R") 
> 
>  > in my .emacs, starting R from Emacs' ESS starts the patched version installed in:
> 
>  > /actuaria/application/ess_app/R-patched/bin
> 
>  > To make this patched version of R available, and third parties versions of R available I had these lines in my .emacs
> 
>  > (setq exec-path (cons "/actuaria/application/ess_app/RevolutionR/bin" exec-path))
>  > (setq exec-path (cons "/actuaria/application/terr/terr21/bin" exec-path))
>  > (setq exec-path (cons "/actuaria/application/ess_app/R-patched/bin" exec-path))
> 
>  > If I comment out the line regarding the R-patched version and also comment out the line
> 
>  > (setq inferior-R-program-name "/usr/bin/R")
> 
>  > everything is fine, ESS starts the latest version of R, BUT R-patched is not
>  > available anymore. How do I set things up so both are available? I do have write
>  > permission ine the "/actuaria/applications/..." directories but not in
>  > "/user/bin" and other system's directories.
> 
>  > Thanks,
> 
>  > Gérald
> 
>  > Le 10/10/14, Martin Maechler <maechler at stat.math.ethz.ch> a écrit :
>  >> >>>>> Gérald Jean <gerald.jean at videotron.ca>
>  >> >>>>> on Thu, 9 Oct 2014 13:55:23 -0400 writes:
>  >> 
>  >> > Yes,
>  >> > in fact several times as I played with the settings in my .emacs, trying to make it work. But it works now with the inclusion of Ista's settings.
>  >> 
>  >> Well, but that is really a "last resort" workaround that should
>  >> never be necessary.
>  >> I have not used such a setting for more than 10 years probably !
>  >> 
>  >> At startup, ESS tries (quite a bit) to find all versions of R
>  >> installed on your computer, i.e., (as Vitalie mentioned) in your
>  >> PATH (environment variable) or more precisely in the exec-path
>  >> emacs lisp variable - which is typically initialized from the
>  >> above PATH (and other emacs settings).
>  >> 
>  >> If "the rest" of your computer / emacs setup is "sane", it just
>  >> *should* find the R version.
>  >> 
>  >> More technically what happens:
>  >> In ess-site.el, there's a function ess-r-s-versions-creation
>  >> defined and called. 
>  >> For R, it makes use of the the function
>  >> ess-r-versions-create you could re-call yourself via M-x ess-r-versions-create.
>  >> That functions (re)creates a global variable
>  >> 
>  >> ess-r-versions-created 
>  >> 
>  >> which you can ask about (and see the value) via 
>  >> 
>  >> C-h v ess-r-versions-created 
>  >> 
>  >> For me, its content is humongous, because I - as R core member
>  >> and "R archaelogist" try to keep many versions of R being available:
>  >> 
>  >> So for me, the above shows
>  >> 
>  >> ("R-1.9.1" "R-1.9.0" "R-1.8.0" "R-1.7.1" "R-1.7.0" "R-1.7" "R-1.6.2" "R-1.6.1"
>  >> "R-1.6.0" "R-1.5.1" "R-1.5.0" "R-1.4.1" "R-1.4.0" "R-1.3.1" "R-1.3.0"
>  >> "R-1.2.3" "R-1.2.2" "R-1.2.1" "R-1.2.0" "R-1.1.1" "R-1.1.0" "R-1.0.1"
>  >> "R-1.0.0" "R-2-debian" "R-2.9.2" "R-2.9.1" "R-2.9.0" "R-2.8.1" "R-2.8.0"
>  >> "R-2.7.2" "R-2.7.1" "R-2.7.0" "R-2.6.2" "R-2.6.1" "R-2.6.0" "R-2.5.1"
>  >> "R-2.5.0" "R-2.4.1" "R-2.4.0" "R-2.3.1" "R-2.3.0" "R-2.2.1" "R-2.2.0"
>  >> "R-2.15.3" "R-2.15.2" "R-2.15.1" "R-2.15.0" "R-2.14.2" "R-2.14.1" "R-2.14.0"
>  >> "R-2.13.2" "R-2.13.1" "R-2.13.0" "R-2.12.2" "R-2.12.1" "R-2.12.0" "R-2.11.1"
>  >> "R-2.11.0" "R-2.10.1" "R-2.10.0" "R-2.1.1" "R-2.1.0" "R-2.0.1" "R-2.0.0" ....
>  >> "R-3.1.1" "R-3.1.0" "R-3.0.3" "R-3.0.2" "R-32norm" "R-3.0.1" "R-3.0.0" 
>  >> "R-devel-valgrind-lev2" "R-devel-no-ldouble" "R-devel"
>  >> .... 
>  >> )
>  >> 
>  >> Yes, all these are in my PATH (typically almost all the above via symbolic
>  >> links into a /usr/local/bin/ PATH) when I start emacs.
>  >> 
>  >> Using symbolic links into a directory which is definitely on
>  >> your PATH allows you to have many different versions of R
>  >> available within the same emacs ESS session.
>  >> 
>  >> But it remains a riddle via /usr/bin does not seem to be part
>  >> of your PATH ... or more likely not part of your emacs
>  >> exec-path. That's why Vitalie has asked about those.
>  >> 
>  >> In short, please report (from Emacs)
>  >> 
>  >> C-h v exec-path
>  >> 
>  >> and (from a shell / terminal -- try both M-x shell from inside
>  >> Emacs, and a shell / simple terminal outside emacs) :
>  >> 
>  >> echo $PATH
>  >> 
>  >> 
>  >> Martin
>  >> 
>  >> 
>  >> > Le 09/10/14, Rmh <rmh at temple.edu> a �crit :
>  >> >> did you restart emacs after the installation so its information would be refreshed?
>  >> >> 
>  >> >> Rich
>  >> >> 
>  >> >> Sent from my iPhone
>  >> >> 
>  >> >> > On Oct 9, 2014, at 12:26, "G�rald Jean" <gerald.jean at videotron.ca> wrote:
>  >> >> > 
>  >> >> > Thanks Ista,
>  >> >> > 
>  >> >> > it worked just fine. What surprises me though is that until yesterday,
>  >> >> > before 3.1.1 was installed by admin, I didn't have any special statement
>  >> >> > in my .emacs for the system's version of R, the previous one being
>  >> >> > 2.15.?
>  >> >> > 
>  >> >> > G�rald
>  >> >> > 
>  >> >> > Le 09/10/14, Ista Zahn <istazahn at gmail.com> a �crit :
>  >> >> >> I think you can set inferior-R-program-name, e.g.,
>  >> >> >> 
>  >> >> >> (setq inferior-R-program-name "/usr/bin/R")
>  >> >> >> 
>  >> >> >> However, I don't see that documented in the manual[1], and it seems to
>  >> >> >> be a FAQ. Should this be documented, or is there another recommended
>  >> >> >> way to do it?
>  >> >> >> 
>  >> >> >> Best,
>  >> >> >> Ista
>  >> >> >> 
>  >> >> >> [1] http://ess.r-project.org/Manual/ess.html#Latest-version> >> >> 
>  >> >> >>> On Thu, Oct 9, 2014 at 11:27 AM, "G�rald Jean" <gerald.jean at videotron.ca> wrote:
>  >> >> >>> Hello,
>  >> >> >>> 
>  >> >> >>> I am running R from ESS on a linux box (RedHat). The admin of the server just installed R-3.1.1 in /usr/bin and I can't start it from Emacs, starts OK from the command line just by typing R.
>  >> >> >>> 
>  >> >> >>> I also have a patched version (3.1.0) installed in a private directory. From Emacs, "M-x R", "M-x R-patched" and "M-x R-newest" all start the R-3.1.0 patched version???
>  >> >> >>> 
>  >> >> >>> I also have TERR and Revo64 from RevolutionAnalytics installed in a private directory, I can start any of them from Emacs but not the R-3.1.1, installed in the standard /usr/bin location???
>  >> >> >>> 
>  >> >> >>> Any ideas???
>  >> >> >>> 
>  >> >> >>> Thanks for your support,
>  >> >> >>> 
>  >> >> >>> G�rald Jean
>  >> 
>  >> 
> 
>  > [[alternative HTML version deleted]]
> 
>  > ______________________________________________
>  > ESS-help at r-project.org mailing list
>  > https://stat.ethz.ch/mailman/listinfo/ess-help
> 
>

	[[alternative HTML version deleted]]



More information about the ESS-help mailing list