Open Andrzej-Andrzej opened 2 years ago
Could you please print the output of echo %path%
(from a CMD shell). Also ensure you have rebooted Emacs after setting path, and that there are not trailing \
on path entry.
C:\Program Files\R\R-4.1.0\bin\x64\Rterm.exe; C:\Program Files\R\R-4.1.0\bin; c:\Program Files\R\; C:\rtools40\usr\bin; c:\Program Files\R\R-4.0.0\bin\x64;
Firstly, you shouldn't need to have C:\Program Files\R\R-4.1.0\bin
in your path.
Secondly, you need to have C:\Program Files\R\R-4.1.0\bin\x64
in your path, without the \Rterm.exe
.
What is the result of calling Rterm.exe
in cmd?
I also note that you have an older versions of R in your path which you might want to consider removing.
The result of calling Rterm.exe in cmd is as follows: R version 4.1.0 (2021-05-18) -- "Camp Pontanezen" Copyright (C) 2021 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 (64-bit)
I have changed it in PATH to:
C:\Program Files\R\R-4.1.0\bin\x64
I am so grateful to you because it started working after I rebooted Emacs, thank you very much indeed, I have spent hours on this. My additional questions are as follows if I may:
install.packages(name of any package)
in Emacs, will it be installed to R 4.1 library folder that is showed by .libPaths() so in my case: "C:/Program Files/R/R-4.1.0/library"
?Thanks again and best regards
Andrzej-Andrzej
on Sun, 01 Aug 2021 22:51:00 -0700 writes:Hi, Can you help me to connect emacs (from Goulet's) to R 4.1 x64 on windows 10. It constantly says it is looking for Rterm. I established a proper PATH ( I think) but errors persists. I would be grateful for help how to do it step by step. I read a tons of tutorials but nothing works.
M-x R stopped working for me also with Windows R, I think because of changes in R-Windows packager setup (not the R sources), but have never cared enough to try finding out.
The workaround has been easy enough though:
M-x R-[Tab]
(where [Tab] is the tabulator key (typically above 'Caps Lock') on your keyboard)
does list all installed R versions (for me) including the "virtual" version 'R-newest' and then I can choose the R version.
M-x R-newest
may also always work (it does for me).
Martin Maechler ETH Zurich and R Core and ESS Core teams
@Andrzej-Andrzej see below for answers to your questions
As per https://www.gnu.org/software/emacs/manual/html_node/efaq-w32/Location-of-init-file.html you need to set a user environment variable called HOME
, linked to your home folder e.g., C:\Users\Username
. If you have a file .emacs.d
this will be treated as your init file. Alternatively, you can have a directory .emacs.d\
with the init.el
approach.
The default package installation location is not managed by emacs. See https://stackoverflow.com/questions/31707941/how-do-i-change-the-default-library-path-for-r-packages . If you do not want to use the defaults, consider setting an R_LIBS_USER environment variable. Alternatively, configure your .Rprofile.
See point 1.
If you still getting bugs, you can try setting RPATH
env variable to C:\Program Files\R\R-4.1.0\bin\x64
, but I doubt this will do anything. Instead you will need to report your Emacs version installed, version of ESS, and any config you may have.
Can you execute code from an R buffer, and are you sure the write configuration is set?
Thank you very much @humanfactors and @mmaechler I am starting to getting everything to work properly. I wanted to connect Emacs and R as I was not able to get full output from dev version of the package installation in R. This is because of line and characters limits in R console. No such limits I guess in Emacs. https://github.com/r-spatial/sf/issues/1747
The alternative could have been to explicitly direct your R output to a file 😊
But anything to encourage Emacs ESS adoption is good news right.
The alternative could have been to explicitly direct your R output to a file
How do I do this, because keep_outputs = TRUE doesn't work ?
Hi, Can you help me to connect emacs (from Goulet's) to R 4.1 x64 on windows 10. It constantly says it is looking for Rterm. I established a proper PATH ( I think) but errors persists. I would be grateful for help how to do it step by step. I read a tons of tutorials but nothing works.