[ESS] Finding all versions of R on Windows when R not in default directory

Richard M. Heiberger rmh at temple.edu
Sat Sep 8 15:04:01 CEST 2012


Fortunately it got through to the OP.  Here it is again, this time renamed
as a .txt file.

This is not registry based.  The default continues to use the default
location of
the R installation.  The alternative lets the user define a new starting
position instead
of Program Files or its equivalent in the Environment Variables.

On Sat, Sep 8, 2012 at 7:05 AM, Vitalie Spinu <spinuvit at gmail.com> wrote:

>
> Hi Richard,
>
> You attachment didn't get trough. Can you please send it in plain text?
>
> Is this a registry look-up which we discussed before?
>
>     Vitalie.
>
>
>   >> "Richard M. Heiberger" <rmh at temple.edu>
>   >> on Sat, 8 Sep 2012 00:14:36 -0400 wrote:
>
>   > McKay,
>
>   > Here is a workaround for those who are not faint-of-heart in working
> with
>   > .el files.
>   > If it works for you and others, we can put it in a future release of
> ESS.
>
>   > In your example, select the second line and comment out the first.
>   > I tested it on Windows 7 with ESS 12.04-4 using the first line and the
>   > third line.
>
>   > On proper installation, the first three lines will become potential
> values
>   > for a new
>   > customized variable, and the first line will be the default value.
>
>   > Rich
>
>   > On Fri, Sep 7, 2012 at 10:25 PM, S. McKay Curtis
>   > <s.mckay.curtis at gmail.com>wrote:
>
>   >> Hi all,
>   >>
>   >> I recently installed R in a Windows directory other than the default
>   >>
>   >> "C:/R/R-2.15.1/"
>   >>
>   >> rather than
>   >>
>   >> "C:/Program Files/R/R-2.15.1"
>   >>
>   >> to help Rcpp play nice on Windows.  Unfortunately, ESS cannot find any
>   >> versions of R on my system now.  My "exec-path" contains a path to the
>   >> "bin" folder of the new installation of R, and I even tried adding
>   >> two additional paths to the "exec-path" (the "bin/i386" and
> "bin/x64"), but
>   >> this did not seem to help.
>   >>
>   >> Any ideas?
>   >>
>   >> Thanks!
>   >> McKay
>   >>
>   >> P.S. I'm using Vincent Goulet's fabulous windows Emacs bundle, if
> that's
>   >> useful information for anybody.
>   >>
>   >> [[alternative HTML version deleted]]
>   >>
>   >> ______________________________________________
>   >> ESS-help at r-project.org mailing list
>   >> https://stat.ethz.ch/mailman/listinfo/ess-help>
>
>   > ______________________________________________
>   > ESS-help at r-project.org mailing list
>   > https://stat.ethz.ch/mailman/listinfo/ess-help
>
-------------- next part --------------
(setq ess-user-specified-R-location nil)    ;; default value will be nil ;; rmh
;;(setq ess-user-specified-R-location "c:") ;; example non-default value ;; rmh
;;(setq ess-user-specified-R-location "c:/Progra~1") ;; standard value   ;; rmh
  (if ess-microsoft-p
      (setq ess-rterm-version-paths ;; (ess-find-rterm))
  	  (ess-flatten-list
  	   (ess-uniq-list
  	    (if (not ess-user-specified-R-location)                      ;; rmh
  		(if (getenv "ProgramW6432")
  		    (let ((P-1 (getenv "ProgramFiles(x86)"))
  			  (P-2 (getenv "ProgramW6432")))
  		      (nconc
  		       ;; always 32 on 64 bit OS, nil on 32 bit OS
  		       (ess-find-rterm (concat P-1 "/R/") "bin/Rterm.exe")
  		       (ess-find-rterm (concat P-1 "/R/") "bin/i386/Rterm.exe")
  		       ;; keep this both for symmetry and because it can happen:
  		       (ess-find-rterm (concat P-1 "/R/") "bin/x64/Rterm.exe")

  		       ;; always 64 on 64 bit OS, nil on 32 bit OS
  		       (ess-find-rterm (concat P-2 "/R/") "bin/Rterm.exe")
  		       (ess-find-rterm (concat P-2 "/R/") "bin/i386/Rterm.exe")
  		       (ess-find-rterm (concat P-2 "/R/") "bin/x64/Rterm.exe")
  		       ))
  		  (let ((PF (getenv "ProgramFiles")))
  		    (nconc
  		     ;; always 32 on 32 bit OS, depends on 32 or 64 process on 64 bit OS
  		     (ess-find-rterm (concat PF "/R/") "bin/Rterm.exe")
  		     (ess-find-rterm (concat PF "/R/") "bin/i386/Rterm.exe")
  		     (ess-find-rterm (concat PF "/R/") "bin/x64/Rterm.exe")
  		     ))
  		  )                                                      ;; rmh
  	      (let ((PF ess-user-specified-R-location))                  ;; rmh
  		(nconc                                                   ;; rmh
  		 (ess-find-rterm (concat PF "/R/") "bin/Rterm.exe")      ;; rmh
  		 (ess-find-rterm (concat PF "/R/") "bin/i386/Rterm.exe") ;; rmh
  		 (ess-find-rterm (concat PF "/R/") "bin/x64/Rterm.exe")  ;; rmh
  		 ))
  	      )))))

;; replace lines 553-559 of ess-site.el in ESS 12.04-4 with the lines in this file.
;; Uncomment exactly one of the three initial lines here.
;; If you choose line 2, set it for your machine.
;; The R-location is the directory containing R/R-2.15.1/


More information about the ESS-help mailing list