Command to see 'R' path that RStudio is using

后端 未结 1 1979
盖世英雄少女心
盖世英雄少女心 2020-12-14 17:07

Original Question

This seems easy and has likely been asked before, but I could not find it via a search.


I have a few flavors of R inst

1条回答
  •  醉梦人生
    2020-12-14 17:12

    (Edited to reflect fact that this is apparently a Windows-specific solution.)

    Here on Windows, I'd use the following, for reasons discussed here by Henrik Bengtsson near the start of a long thread on the subject.

    file.path(R.home("bin"), "R")
    

    This is better than using file.path(R.home(), "bin", "R") in several settings alluded to in the "Value" section of this snippet from help(R.home):

    Details:

    The R home directory is the top-level directory of the R installation being run.

    [...]

    Value:

    A character string giving the R home directory or path to a particular component. Normally the components are all subdirectories of the R home directory, but this may not be the case in a Unix-like installation. [...] The return value for "modules" and on Windows "bin" is to a sub-architecture-specific location.

    0 讨论(0)
提交回复
热议问题