FAQ
Hello all,


I am trying to customize my ESS so that I can easily refer to older version
of R as needed to use packages that are not compatible with the most up to
date R version.


I am currently running GNU Emacs 24.1.1 with ESS Version 14.09. I use Emacs
and ESS on a linux server where the main R version is kept at /local/bin/R
which refers to version 3.1.1 via a symbolic link.


When I am in Emacs and type M-x R-[tab] I do not see any R versions come up
in my completions list. My current completions list is:
Possible completions are:
R-fix-T-F R-initialize-on-start R-mode
R-newest R-site-search R-transcript-mode


I had seen that you could set R-devel in older versions of ESS, but I do
not see that as a variable now.


I have explored the variable (ess-r-versions-created) and found its value
to be nil. I then looked at (ess-rterm-version-paths) and also found that
to have a value of nil.


I then tried to edit my .emacs file to set the (ess-rterm-version-paths)
variable to the path to R version 3.0.1 located in my bin with the
following addition to my .emacs file under (custom-set-variables


'(ess-rterm-version-paths "/udd/user/bin/R-3.0.1")


However, this only updated the ess-rterm-version-paths variable and did not
update the ess-r-versions-created variable. So, with this change I could
not use M-x R-3.0.1.


I also tried running M-x ess-find-rterm, but this command does not exist
for me.


Simply put, I want to find a way to customize ESS so that by default I use
the most updated R version on our server located at /local/bin/R with an
option to easily choose an older version of R local in my personal
directory at /udd/user/bin/R-3.0.1.


I would appreciate any help or advice that anyone could offer.


Thank you,
Brian


  [[alternative HTML version deleted]]

Search Discussions

  • Vitalie Spinu at Oct 17, 2014 at 1:45 am
    Theoretically, it should be enough to have a sim-link of your R binaries
    into your bin path. This seems to work very well for
    Martin. Unfortunately it never worked for me. I have multiple R
    installed and simlinked but I don't see any of them.


    I had in plan to check what is going on for ages and never got down to
    it as it never bothered me that much.


    As a quick workaround you can have:


        (defun R-x.y.z ()
          (interactive)
          (let ((inferior-R-program-name "path/to/xyz/R"))
            (R)))


      Vitalie

    Brian Hobbs on Thu, 16 Oct 2014 15:51:56 -0400 wrote:
    Hello all,
    I am trying to customize my ESS so that I can easily refer to older version
    of R as needed to use packages that are not compatible with the most up to
    date R version.
    I am currently running GNU Emacs 24.1.1 with ESS Version 14.09. I use Emacs
    and ESS on a linux server where the main R version is kept at /local/bin/R
    which refers to version 3.1.1 via a symbolic link.
    When I am in Emacs and type M-x R-[tab] I do not see any R versions come up
    in my completions list. My current completions list is:
    Possible completions are:
    R-fix-T-F R-initialize-on-start R-mode
    R-newest R-site-search R-transcript-mode
    I had seen that you could set R-devel in older versions of ESS, but I do
    not see that as a variable now.
    I have explored the variable (ess-r-versions-created) and found its value
    to be nil. I then looked at (ess-rterm-version-paths) and also found that
    to have a value of nil.
    I then tried to edit my .emacs file to set the (ess-rterm-version-paths)
    variable to the path to R version 3.0.1 located in my bin with the
    following addition to my .emacs file under (custom-set-variables
    '(ess-rterm-version-paths "/udd/user/bin/R-3.0.1")
    However, this only updated the ess-rterm-version-paths variable and did not
    update the ess-r-versions-created variable. So, with this change I could
    not use M-x R-3.0.1.
    I also tried running M-x ess-find-rterm, but this command does not exist
    for me.
    Simply put, I want to find a way to customize ESS so that by default I use
    the most updated R version on our server located at /local/bin/R with an
    option to easily choose an older version of R local in my personal
    directory at /udd/user/bin/R-3.0.1.
    I would appreciate any help or advice that anyone could offer.
    Thank you,
    Brian
    [[alternative HTML version deleted]]
    ______________________________________________
    ESS-help at r-project.org mailing list
    https://stat.ethz.ch/mailman/listinfo/ess-help
  • Martin Maechler at Oct 18, 2014 at 3:59 pm

    On Fri, Oct 17, 2014 at 3:45 AM, Vitalie Spinu wrote:
    Theoretically, it should be enough to have a sim-link of your R binaries
    into your bin path. This seems to work very well for
    Martin. Unfortunately it never worked for me. I have multiple R
    installed and simlinked but I don't see any of them.

    I am astonished.. that it doesn't work for you neither, Vitalie.
    Are the R versions found in a *shell* buffer inside Emacs?


    What OS are we talking about

    I had in plan to check what is going on for ages and never got down to
    it as it never bothered me that much.

    As a quick workaround you can have:

    (defun R-x.y.z ()
    (interactive)
    (let ((inferior-R-program-name "path/to/xyz/R"))
    (R)))

    Indeed, that used to be my "workaround" i.e., solution, many years
    ago, before we had all the auto detection.
    Still very strange that it fails for you..
    and of course it would phantastic if Vitalie could diagnose the
    problem for himself, as the solution would benefit
    quite a few people I'm sure.


    Martin

    Vitalie
    Brian Hobbs on Thu, 16 Oct 2014 15:51:56 -0400 wrote:
    Hello all,
    I am trying to customize my ESS so that I can easily refer to older version
    of R as needed to use packages that are not compatible with the most up to
    date R version.
    I am currently running GNU Emacs 24.1.1 with ESS Version 14.09. I use Emacs
    and ESS on a linux server where the main R version is kept at /local/bin/R
    which refers to version 3.1.1 via a symbolic link.
    When I am in Emacs and type M-x R-[tab] I do not see any R versions come up
    in my completions list. My current completions list is:
    Possible completions are:
    R-fix-T-F R-initialize-on-start R-mode
    R-newest R-site-search R-transcript-mode
    I had seen that you could set R-devel in older versions of ESS, but I do
    not see that as a variable now.
    I have explored the variable (ess-r-versions-created) and found its value
    to be nil. I then looked at (ess-rterm-version-paths) and also found that
    to have a value of nil.
    I then tried to edit my .emacs file to set the (ess-rterm-version-paths)
    variable to the path to R version 3.0.1 located in my bin with the
    following addition to my .emacs file under (custom-set-variables
    '(ess-rterm-version-paths "/udd/user/bin/R-3.0.1")
    However, this only updated the ess-rterm-version-paths variable and did not
    update the ess-r-versions-created variable. So, with this change I could
    not use M-x R-3.0.1.
    I also tried running M-x ess-find-rterm, but this command does not exist
    for me.
    Simply put, I want to find a way to customize ESS so that by default I use
    the most updated R version on our server located at /local/bin/R with an
    option to easily choose an older version of R local in my personal
    directory at /udd/user/bin/R-3.0.1.
    I would appreciate any help or advice that anyone could offer.
    Thank you,
    Brian
    [[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
  • Vitalie Spinu at Oct 18, 2014 at 10:35 pm

    Martin Maechler on Sat, 18 Oct 2014 17:59:36 +0200 wrote:
    I am astonished.. that it doesn't work for you neither, Vitalie. Are
    the R versions found in a *shell* buffer inside Emacs?

      Yes, they are in the path. I will investigate.




        Vitalie
  • Stephen Eglen at Oct 19, 2014 at 5:43 am

    I am astonished.. that it doesn't work for you neither, Vitalie.
    Are the R versions found in a *shell* buffer inside Emacs?

    me too. I wrote the code to autodetect R on Unix, and used symlinks to
    test it. I can help fix.


    S
  • Vitalie Spinu at Oct 19, 2014 at 10:02 pm
    Before I look into it would be nice to precisely understand the expected
    behavior.


    I have just got a new system and got R devel installed from
    source in ~/bin/R-patched/, then I


       cd ~/bin && ln -sf R-patched/bin/R R-latest


    and re-started Emacs. Then M-x R- TAB, no R-latest in there.


    So, R-latest should have been created and should have been in the
    completion list, right?




       Vitalie

    Stephen Eglen on Sun, 19 Oct 2014 06:43:22 +0100 wrote:
    I am astonished.. that it doesn't work for you neither, Vitalie.
    Are the R versions found in a *shell* buffer inside Emacs?
    me too. I wrote the code to autodetect R on Unix, and used symlinks to
    test it. I can help fix.
    S
  • Stephen Eglen at Oct 19, 2014 at 10:44 pm

    I have just got a new system and got R devel installed from
    source in ~/bin/R-patched/, then I

    cd ~/bin && ln -sf R-patched/bin/R R-latest

    and re-started Emacs. Then M-x R- TAB, no R-latest in there.

    So, R-latest should have been created and should have been in the
    completion list, right?

    No (close, but no). I hope


    cd ~/bin && ln -sf R-patched/bin/R R-patched-latest


    would work; see:
    ----------------------------------------------------------------------
    ess-r-versions is a variable defined in `ess-r-d.el'.
    Its value is ("R-1" "R-2" "R-3" "R-devel" "R-patched" "R32" "R64")


    Documentation:
    List of partial strings for versions of R to access within ESS.
    Each string specifies the start of a filename. If a filename
    beginning with one of these strings is found on `exec-path', a M-x
    command for that version of R is made available. For example, if the
    file "R-1.8.1" is found and this variable includes the string
    "R-1", a function called `M-x R-1.8.1' will be available to run that
    version of R.
    If duplicate versions of the same program are found (which happens if
    the same path is listed on `exec-path' more than once), they are
    ignored by calling `ess-uniq-list'.
    Set this variable to nil to disable searching for other versions of R.
    If you set this variable, you need to restart Emacs (and set this variable
    before ess-site is loaded) for it to take effect.
  • Vitalie Spinu at Oct 19, 2014 at 11:27 pm
    Ok, that was it. It works with the right prefix. Thanks for the tip. I
    was always calling the devel version R-dev, I wish I would not have
    saved two letters.


    One last thing, ess-r-versions doesn't sounds right to me. Shouldn't it
    be something like `ess-R-program-start-strings` or `ess-R-program-partial-names`?


       Vitalie

    Stephen Eglen on Sun, 19 Oct 2014 23:44:15 +0100 wrote:
    I have just got a new system and got R devel installed from
    source in ~/bin/R-patched/, then I
      >>
    cd ~/bin && ln -sf R-patched/bin/R R-latest
      >>
    and re-started Emacs. Then M-x R- TAB, no R-latest in there.
      >>
    So, R-latest should have been created and should have been in the
    completion list, right?
    No (close, but no). I hope
    cd ~/bin && ln -sf R-patched/bin/R R-patched-latest
    would work; see:
    ----------------------------------------------------------------------
    ess-r-versions is a variable defined in `ess-r-d.el'.
    Its value is ("R-1" "R-2" "R-3" "R-devel" "R-patched" "R32" "R64")
    Documentation:
    List of partial strings for versions of R to access within ESS.
    Each string specifies the start of a filename. If a filename
    beginning with one of these strings is found on `exec-path', a M-x
    command for that version of R is made available. For example, if the
    file "R-1.8.1" is found and this variable includes the string
    "R-1", a function called `M-x R-1.8.1' will be available to run that
    version of R.
    If duplicate versions of the same program are found (which happens if
    the same path is listed on `exec-path' more than once), they are
    ignored by calling `ess-uniq-list'.
    Set this variable to nil to disable searching for other versions of R.
    If you set this variable, you need to restart Emacs (and set this variable
    before ess-site is loaded) for it to take effect.
    ----------------------------------------------------------------------
  • Stephen Eglen at Oct 20, 2014 at 8:21 am

    One last thing, ess-r-versions doesn't sounds right to me. Shouldn't it
    be something like `ess-R-program-start-strings` or
    `ess-R-program-partial-names`?

    I agree; your two choices would be more appropriate. I doubt many
    people have customized this variable, so I think renaming it shouldn't
    hurt (with a defalias for the old var?).


    Stephen
  • Martin Maechler at Oct 23, 2014 at 10:38 am

    Stephen Eglen <s.j.eglen@damtp.cam.ac.uk>
    on Mon, 20 Oct 2014 09:21:11 +0100 writes:
    One last thing, ess-r-versions doesn't sounds right to me. Shouldn't it
    be something like `ess-R-program-start-strings` or
    `ess-R-program-partial-names`?
    I agree; your two choices would be more appropriate. I doubt many
    people have customized this variable, so I think renaming it shouldn't
    hurt (with a defalias for the old var?).
    Stephen

    Sounds good {particularly with the defalias for safety!}...
    even I have not customized it anymore..


    Martin
  • Vitalie Spinu at Oct 27, 2014 at 11:18 pm
    How about having only `R-program-start-regexp` and set it to "^R-"?


        Vitalie



    Martin Maechler on Thu, 23 Oct 2014 12:38:38 +0200 wrote:
    Stephen Eglen <s.j.eglen@damtp.cam.ac.uk>
    on Mon, 20 Oct 2014 09:21:11 +0100 writes:
    One last thing, ess-r-versions doesn't sounds right to me. Shouldn't it
    be something like `ess-R-program-start-strings` or
    `ess-R-program-partial-names`?
    I agree; your two choices would be more appropriate. I doubt many
    people have customized this variable, so I think renaming it shouldn't
    hurt (with a defalias for the old var?).
    Stephen
    Sounds good {particularly with the defalias for safety!}...
    even I have not customized it anymore..
    Martin
  • Stephen Eglen at Oct 28, 2014 at 5:55 am
    How about having only `R-program-start-regexp` and set it to "^R-"?

    okay, but "start-regexp" is confusing: 1) if it
    says start, would you expect to have to add ^ [caret] for start of
    string 2) ess-find-exec-completions() does the hard work of finding the
    R versions, and a quick browse suggests that ess-r-versions should
    contain strings, not regexps.


    S
  • Vitalie Spinu at Oct 28, 2014 at 7:56 am

    Stephen Eglen on Tue, 28 Oct 2014 05:55:54 +0000 wrote:
    How about having only `R-program-start-regexp` and set it to "^R-"?
    okay, but "start-regexp" is confusing: 1) if it says start, would you
    expect to have to add ^ [caret] for start of string

    Good point. R-program-name-regexp is better.

    2) ess-find-exec-completions() does the hard work of finding the R
    versions, and a quick browse suggests that ess-r-versions should
    contain strings, not regexps.

    Sure. The idea was to change the code a bit and make the whole interface
    simpler and more general all at once.


    But now that I think about it, it's probably not worth the flame. Better
    to rename ess-R-versions and leave only one "R-" string in that list.




       Vitalie
  • Martin Maechler at Oct 28, 2014 at 8:02 am
    On Tue, Oct 28, 2014 at 8:56 AM, Vitalie Spinu wrote:

    Stephen Eglen on Tue, 28 Oct 2014 05:55:54 +0000 wrote:
    How about having only `R-program-start-regexp` and set it to "^R-"?
    okay, but "start-regexp" is confusing: 1) if it says start, would you
    expect to have to add ^ [caret] for start of string
    Good point. R-program-name-regexp is better.
    2) ess-find-exec-completions() does the hard work of finding the R
    versions, and a quick browse suggests that ess-r-versions should
    contain strings, not regexps.
    Sure. The idea was to change the code a bit and make the whole interface
    simpler and more general all at once.

    But now that I think about it, it's probably not worth the flame. Better
    to rename ess-R-versions and leave only one "R-" string in that list.

    ?Renaming is fine... but the 2nd proposal is not really:


    See, many people / instituttions have small?


    ?R related helper utilities in their PATH,
    and we have named most of them "R-<foo>" or sometimes "R-<foo>-<bar>"? but
    have left exactly the
    R-<n>... , R-patched* and R-devel* for R versions.


    Making all "R-" strings into potential R executables would be quite
    disruptive for all those places.
    So, no, do not extend that list.
    Martin


    Vitalie

      [[alternative HTML version deleted]]
  • Ramon Diaz-Uriarte at Oct 29, 2014 at 11:50 am
    So the 0.02 cents of a elisp-illiterate user: I've actually used that
    variable (ess-r-versions) from time to time over the yeast, and I find its
    current behavior simple and (even) intuitive:


    Most of the time (when I do not setq the variable to anything) things just
    work fine out of the box and I never touch the variable. Now, if I need
    something exotic (e.g., I had an R-99 around once, because of some naming
    conventions of mine), I place the relevant piece (enough to disambiguate)
    in the setq, eval it, and things just work.


    As for the name, I actually see the point of it being called
    "ess-r-versions": the R versions (or names for the versions) that ess knows
    about.




    So I would not change a thing (but of course, I do none of the work of
    changing/not-changing or maintaining the code, so disregard as
    appropriate).




    Best,




    R.







    On Tue, 28-10-2014, at 09:02, Martin Maechler wrote:
    On Tue, Oct 28, 2014 at 8:56 AM, Vitalie Spinu wrote:


    Stephen Eglen on Tue, 28 Oct 2014 05:55:54 +0000 wrote:
    How about having only `R-program-start-regexp` and set it to "^R-"?
    okay, but "start-regexp" is confusing: 1) if it says start, would you
    expect to have to add ^ [caret] for start of string
    Good point. R-program-name-regexp is better.
    2) ess-find-exec-completions() does the hard work of finding the R
    versions, and a quick browse suggests that ess-r-versions should
    contain strings, not regexps.
    Sure. The idea was to change the code a bit and make the whole interface
    simpler and more general all at once.

    But now that I think about it, it's probably not worth the flame. Better
    to rename ess-R-versions and leave only one "R-" string in that list.
    ?Renaming is fine... but the 2nd proposal is not really:

    See, many people / instituttions have small?

    ?R related helper utilities in their PATH,
    and we have named most of them "R-<foo>" or sometimes "R-<foo>-<bar>"? but
    have left exactly the
    R-<n>... , R-patched* and R-devel* for R versions.

    Making all "R-" strings into potential R executables would be quite
    disruptive for all those places.
    So, no, do not extend that list.
    Martin

    Vitalie
    [[alternative HTML version deleted]]

    ______________________________________________
    ESS-help at r-project.org mailing list
    https://stat.ethz.ch/mailman/listinfo/ess-help

    --
    Ramon Diaz-Uriarte
    Department of Biochemistry, Lab B-25
    Facultad de Medicina
    Universidad Aut?noma de Madrid
    Arzobispo Morcillo, 4
    28029 Madrid
    Spain


    Phone: +34-91-497-2412


    Email: rdiaz02 at gmail.com
            ramon.diaz at iib.uam.es


    http://ligarto.org/rdiaz

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupess-help @
categoriesr
postedOct 16, '14 at 7:51p
activeOct 29, '14 at 11:50a
posts15
users5
websiteess.r-project.org
irc#r

People

Translate

site design / logo © 2022 Grokbase