[ESS] Finding 64-bit R versions on Windows

Stephen Eglen S.J.Eglen at damtp.cam.ac.uk
Wed Jul 9 13:09:09 CEST 2014


hi Kevin,

I think we could add something like this, but as I'm not on Windows, we
might need some help testing it (+ Rich?).  On unix we already have "M-x
R-newest"; what does that do for you on Windows?

Perhaps on the mac we also have the choice of 64 or 32 bit?  In which
case we could have a variable like

(defcustom ess-prefer-64bit t)

to allow us to set a preference for 64 bit.


Some help with elisp below:


> ;; This hack finds the latest 64-bit version.
> (defun R64 (&optional start-args)
>    "Call the latest 64-bit version of R"
>    (interactive "P")
>    ;; sweep through the list of R-version commands
>    ;; to find the 64-bit ones
>    (defun m64 (target)
>      "remove string '-64bit' from target"
>      (if (string-match "-64bit" target)
>      (replace-match "" t t target)
>        ))

if you have an (if ) with no else portion, as you do here, just rewrite
it as:

  (when (string-match "-64bit" target)
     (replace-match "" t t target))




>     ;; now use the newest version that matches a 64-bit version
>     (defun krc-in-newest (source)

>       (if source
>       (if (string-match source ess-newest-R)
>           (concat source "-64bit")
>         nil)
>         nil))

that can probably be simplified:

  (when (and source (string-match source ess-newest-R))
    (concat source "-64bit"))


all untested though of course!



More information about the ESS-help mailing list