;; the "latest" code always picks the 32-bit version. 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) )) (setq nobits(delq nil (mapcar 'm64 ess-r-versions-created))) ;; 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)) (setq pending (delq nil (mapcar 'krc-in-newest nobits))) ;; take the first one (setq myname (car pending)) ;; convert from string to symbol (setq mysym (intern-soft myname)) ;; look up the function from the symbol (setq myfun (symbol-function mysym)) ;; invoke it (funcall myfun start-args) )