Re: [ESS] Have M-x R point at the most recent version of R

2023-10-04 Thread Dominic Steinitz via ESS-help
I have been meaning to reply to this for some time and maybe a partial answer 
now is better than a complete answer in several months time.

I use envrc https://github.com/purcell/envrc with direnv https://direnv.net/ 
and nix https://nixos.org/. With these I can have a different R (and different 
packages) in each project I work on and emacs and any shells automatically pick 
up this version and required libraries. Just to be clear I can have different 
versions of R in different projects. I can also have different versions of 
packages in different projects. And ESS just picks them up without me 
configuring emacs.

For a project I am working on at the moment I have my R set up as

> let
>   R-with-my-packages = nixpkgs.rWrapper.override{
> packages = with nixpkgs.rPackages; [
>   ggplot2
>   maps
>   rnaturalearth
>   rnaturalearthdata
>   sf
>   tidyverse
> ]; };


And all the dependencies for the R packages are made available (e.g. gdal, 
proj, geos, libtiff) automatically. In this example, I didn’t specify versions 
and let nix choose them for me so I got e.g ggplot 3.4.2 but I could have 
specified a different version e.g. a bug fixed version that hasn’t been 
released to CRAN.

Of course you can use this for much more than R.

PS I want to say thanks to everyone that contributes to ESS and provides help 
on this email channel. It’s a great tool :-) 

Dominic Steinitz
domi...@steinitz.org
http://idontgetoutmuch.org
Twitter: @idontgetoutmuch


[[alternative HTML version deleted]]

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


Re: [ESS] Have M-x R point at the most recent version of R

2023-09-29 Thread Manuel Teodoro via ESS-help
ESS needs C:/Programme/R/R-4.2.2/bin/R.exe

I'm not sure if I'm missing something but it seems to me that you want to
define it in your init file, but then you will have to update it each time
that you change R versions. Use the following line

(setq inferior-ess-r-program "C:/Users/manuel/Bin/R-4.2.2/bin/R.exe")

Change the path for whichever path/version you have. For example, I am
developing some software under version 4.1.2 so, whenever I need to switch
to that I just write in the *scratch* buffer (it works from anywhere
actually) the following

(setq inferior-ess-r-program "C:/Users/manuel/Bin/R-4.1.2/bin/R.exe")

Stand at the very end of the line, C-x C-e to evaluate the expression and
my next R session. Since I don't do it often I just write and evaluate the
line. But it would be easy to create a function that switches versions as
you command it.

For me this is easier than allowing ESS to find it because I don't have it
installed in the default path due to admin restrictions. I hope it can help
you.

Manuel

On Wed, Sep 27, 2023 at 8:30 AM Hüsing, Johannes via ESS-help <
ess-help@r-project.org> wrote:

> Thanks for the hint.
>
> The path variable is now
> %USERPROFILE%\AppData\Local\Microsoft\WindowsApps;%USERPROFILE%\AppData\Local\Programs\MiKTeX\miktex\bin\x64;C:\Program
> Files\R\R-4.3.1\bin;
>
> M-x R will still start R-4.2.2. After renaming C:\Programme\R\R-4.2.2, M-x
> R will lead to Emacs displaying the message:
> C:/Programme/R/R-4.2.2/bin/R program not found
>
> Is there a way to proceed to notify ESS about the new version installed
> and have it start by default?
>
>
>
> Johannes Hüsing
> Epidemiologie
>
>
> Landeskrebsregister NRW gGmbH
> Gesundheitscampus 10
> 44801 Bochum
> T 0234 54509-216
> F 0234 54509-499
> johannes.hues...@krebsregister.nrw.de
> www.landeskrebsregister.nrw.de
>
>
> 1. Landesqualitätskonferenz jetzt anmelden unter Qualitätskonferenzen
> 
> Newsletter LKR NRW jetzt anmelden unter Newsletter
> 
> Geschäftsführer
> Dr. Andres Schützendübel
> Vorsitzender der Gesellschafterversammlung
> Staatssekretär Dr. Edmund Heller
> Sitz der Gesellschaft
> Bochum
> Registergericht
> Amtsgericht Bochum
> HRB 17715
>
> HINWEIS: Diese Nachricht ist nur für den Adressaten bestimmt. Es ist nicht
> erlaubt, diese Nachricht zu kopieren oder Dritten zugänglich zu machen.
> Sollten Sie irrtümlich diese Nachricht erhalten haben, bitte ich um Ihre
> Mitteilung per E-Mail oder unter der oben angegebenen Telefonnummer.
>
>
> -----Ursprüngliche Nachricht-----
> Von: Toby Hocking 
> Gesendet: Dienstag, 26. September 2023 18:02
> An: Hüsing, Johannes 
> Cc: ess-help@r-project.org
> Betreff: Re: [ESS] Have M-x R point at the most recent version of R
>
> I put it on the path,
> Windows key -> Edit the system environment variables -> Environment
> variables... -> Double click Path -> add C:\Program
> Files\R\R-devel\bin\x64 or whatever
>
> On Tue, Sep 26, 2023 at 3:07 AM Hüsing, Johannes via ESS-help <
> ess-help@r-project.org> wrote:
> >
> > Dear ESS-helping crowd,
> > following the advice on https://r-pkgs.org/setup.html, I installed R
> version 4.3.1 for MS Windows from CRAN.
> >
> > How do I communicate to ESS that a new version has been installed? I
> read the advice on
> https://emacs.stackexchange.com/questions/60681/ess-start-process-does-not-include-new-r-version,
> I used the Emacs customisation dialogue to set ess-rterm-version-paths from
> C:/Program Files/R/R-4.2.2/bin/x64/Rterm.exe to C:/Program
> Files/R/R-4.3.1/bin/x64/Rterm.exe. After that, the variable
> ess-r-runner-prefixes, as well as ess-r-versions resolves to ("R-1" "R-2"
> "R-3" "R-4" "R-5" "R-6" "R-7" "R-devel" "R-patched"), and both M-x R and
> M-x R-newest will start R 4.2.2. The variable ess-r-versions-created
> resolves to (R-4.2.2-64bit), as does its alias ess-r-created-runners.
> Neither of these is customizable in the Emacs dialog.
> >
> > Is there a way to proceed to notify ESS about the new version installed?
> RStudio opened a miniscule dialog window indicating that it detected
> conflicting versions and had me choose one of them.
> >
> > Thanks for any hint.
> >
> >
> >
> > Dr. Johannes Hüsing
> > Epidemiologie
> >
> > Landeskrebsregister NRW gGmbH
> > Gesundheitscampus 10
> > 44801 Bochum
> >
> >
> >
> > T 0234 54509-216
> > F 0234 54509-499
> > johannes.hues...@krebsregister.nrw.de<mailto:Johannes.Huesing@krebsreg
> > ister.nrw.de>
> > www.landeskrebsregister.nrw<http://www.landeskrebsr

Re: [ESS] Have M-x R point at the most recent version of R

2023-09-27 Thread Hüsing , Johannes via ESS-help
Mark, thanks for this hint, which reminded me to check the entries in my  
.emacs.d/init.el file.

> I set the R version using something like this in my init file:
> (setq inferior-ess-r-program "C:/Program Files/R/R-4.3.1/bin/x64/Rterm.exe")

I commented out (setq inferior-ess-r-program "C:/Program 
Files/R/R-4.2.2/bin/x64/Rterm.exe") in my init.el and after restarting Emacs, 
things seem to work now.

Best wishes

Johannes


Johannes Hüsing
Epidemiologie


Landeskrebsregister NRW gGmbH
Gesundheitscampus 10
44801 Bochum
T 0234 54509-216
F 0234 54509-499
johannes.hues...@krebsregister.nrw.de
www.landeskrebsregister.nrw.de


1. Landesqualitätskonferenz jetzt anmelden unter Qualitätskonferenzen 

Newsletter LKR NRW jetzt anmelden unter Newsletter 

Geschäftsführer
Dr. Andres Schützendübel
Vorsitzender der Gesellschafterversammlung
Staatssekretär Dr. Edmund Heller
Sitz der Gesellschaft
Bochum
Registergericht
Amtsgericht Bochum
HRB 17715

HINWEIS: Diese Nachricht ist nur für den Adressaten bestimmt. Es ist nicht 
erlaubt, diese Nachricht zu kopieren oder Dritten zugänglich zu machen. Sollten 
Sie irrtümlich diese Nachricht erhalten haben, bitte ich um Ihre Mitteilung per 
E-Mail oder unter der oben angegebenen Telefonnummer.


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


Re: [ESS] Have M-x R point at the most recent version of R

2023-09-27 Thread Mark Seeto via ESS-help
Hi Johannes,

I set the R version using something like this in my init file:
(setq inferior-ess-r-program "C:/Program Files/R/R-4.3.1/bin/x64/Rterm.exe")

But I'm still using ESS 18.10.2 (in Vincent Goulet's Emacs
distribution) so that line might not be the right way to do it in the
version you're using.

Hope that helps.

Mark


> Date: Wed, 27 Sep 2023 06:30:24 +
> From: =?utf-8?B?SMO8c2luZywgSm9oYW5uZXM=?=
>  
> To: Toby Hocking 
> Cc: "ess-help@r-project.org" 
> Subject: Re: [ESS] Have M-x R point at the most recent version of R
> Message-ID: <36cdec6aa7934e27a2f3c1436f03a...@krebsregister.nrw.de>
> Content-Type: text/plain; charset="utf-8"
>
> Thanks for the hint.
>
> The path variable is now 
> %USERPROFILE%\AppData\Local\Microsoft\WindowsApps;%USERPROFILE%\AppData\Local\Programs\MiKTeX\miktex\bin\x64;C:\Program
>  Files\R\R-4.3.1\bin;
>
> M-x R will still start R-4.2.2. After renaming C:\Programme\R\R-4.2.2, M-x R 
> will lead to Emacs displaying the message:
> C:/Programme/R/R-4.2.2/bin/R program not found
>
> Is there a way to proceed to notify ESS about the new version installed and 
> have it start by default?
>
>
>
> Johannes Hüsing
> Epidemiologie
>

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


Re: [ESS] Have M-x R point at the most recent version of R

2023-09-27 Thread Hüsing , Johannes via ESS-help
Thanks for the hint.

The path variable is now 
%USERPROFILE%\AppData\Local\Microsoft\WindowsApps;%USERPROFILE%\AppData\Local\Programs\MiKTeX\miktex\bin\x64;C:\Program
 Files\R\R-4.3.1\bin;

M-x R will still start R-4.2.2. After renaming C:\Programme\R\R-4.2.2, M-x R 
will lead to Emacs displaying the message:
C:/Programme/R/R-4.2.2/bin/R program not found

Is there a way to proceed to notify ESS about the new version installed and 
have it start by default?



Johannes Hüsing
Epidemiologie


Landeskrebsregister NRW gGmbH
Gesundheitscampus 10
44801 Bochum
T 0234 54509-216
F 0234 54509-499
johannes.hues...@krebsregister.nrw.de
www.landeskrebsregister.nrw.de


1. Landesqualitätskonferenz jetzt anmelden unter Qualitätskonferenzen 

Newsletter LKR NRW jetzt anmelden unter Newsletter 

Geschäftsführer
Dr. Andres Schützendübel
Vorsitzender der Gesellschafterversammlung
Staatssekretär Dr. Edmund Heller
Sitz der Gesellschaft
Bochum
Registergericht
Amtsgericht Bochum
HRB 17715

HINWEIS: Diese Nachricht ist nur für den Adressaten bestimmt. Es ist nicht 
erlaubt, diese Nachricht zu kopieren oder Dritten zugänglich zu machen. Sollten 
Sie irrtümlich diese Nachricht erhalten haben, bitte ich um Ihre Mitteilung per 
E-Mail oder unter der oben angegebenen Telefonnummer.


-Ursprüngliche Nachricht-
Von: Toby Hocking 
Gesendet: Dienstag, 26. September 2023 18:02
An: Hüsing, Johannes 
Cc: ess-help@r-project.org
Betreff: Re: [ESS] Have M-x R point at the most recent version of R

I put it on the path,
Windows key -> Edit the system environment variables -> Environment 
variables... -> Double click Path -> add C:\Program
Files\R\R-devel\bin\x64 or whatever

On Tue, Sep 26, 2023 at 3:07 AM Hüsing, Johannes via ESS-help 
 wrote:
>
> Dear ESS-helping crowd,
> following the advice on https://r-pkgs.org/setup.html, I installed R version 
> 4.3.1 for MS Windows from CRAN.
>
> How do I communicate to ESS that a new version has been installed? I read the 
> advice on 
> https://emacs.stackexchange.com/questions/60681/ess-start-process-does-not-include-new-r-version,
>  I used the Emacs customisation dialogue to set ess-rterm-version-paths from 
> C:/Program Files/R/R-4.2.2/bin/x64/Rterm.exe to C:/Program 
> Files/R/R-4.3.1/bin/x64/Rterm.exe. After that, the variable 
> ess-r-runner-prefixes, as well as ess-r-versions resolves to ("R-1" "R-2" 
> "R-3" "R-4" "R-5" "R-6" "R-7" "R-devel" "R-patched"), and both M-x R and M-x 
> R-newest will start R 4.2.2. The variable ess-r-versions-created resolves to 
> (R-4.2.2-64bit), as does its alias ess-r-created-runners. Neither of these is 
> customizable in the Emacs dialog.
>
> Is there a way to proceed to notify ESS about the new version installed? 
> RStudio opened a miniscule dialog window indicating that it detected 
> conflicting versions and had me choose one of them.
>
> Thanks for any hint.
>
>
>
> Dr. Johannes Hüsing
> Epidemiologie
>
> Landeskrebsregister NRW gGmbH
> Gesundheitscampus 10
> 44801 Bochum
>
>
>
> T 0234 54509-216
> F 0234 54509-499
> johannes.hues...@krebsregister.nrw.de<mailto:Johannes.Huesing@krebsreg
> ister.nrw.de>
> www.landeskrebsregister.nrw<http://www.landeskrebsregister.nrw>
>
> Das Landeskrebsregister NRW online
> FACEBOOK:
> www.facebook.com/LKR.NordrheinWestfalen<http://www.facebook.com/LKR.No
> rdrheinWestfalen>
> INSTAGRAM: https://www.instagram.com/landeskrebsregister_nrw
> NEWSLETTER: https://www.landeskrebsregister.nrw/aktuelles/newsletter
>
>
> Geschäftsführer
> Dr. Andres Schützendübel
> Vorsitzender der Gesellschafterversammlung Staatssekretär Matthias
> Heidmeier Sitz der Gesellschaft Bochum Registergericht Amtsgericht
> Bochum HRB 17715
>
> HINWEIS: Diese Nachricht ist nur für den Adressaten bestimmt. Es ist nicht 
> erlaubt, diese Nachricht zu kopieren oder Dritten zugänglich zu machen. 
> Sollten Sie irrtümlich diese Nachricht erhalten haben, bitte ich um Ihre 
> Mitteilung per E-Mail oder unter der oben angegebenen Telefonnummer.
>
> [[alternative HTML version deleted]]
>
> __
> ESS-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help
__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] Have M-x R point at the most recent version of R

2023-09-26 Thread Toby Hocking via ESS-help
I put it on the path,
Windows key -> Edit the system environment variables -> Environment
variables... -> Double click Path -> add C:\Program
Files\R\R-devel\bin\x64 or whatever

On Tue, Sep 26, 2023 at 3:07 AM Hüsing, Johannes via ESS-help
 wrote:
>
> Dear ESS-helping crowd,
> following the advice on https://r-pkgs.org/setup.html, I installed R version 
> 4.3.1 for MS Windows from CRAN.
>
> How do I communicate to ESS that a new version has been installed? I read the 
> advice on 
> https://emacs.stackexchange.com/questions/60681/ess-start-process-does-not-include-new-r-version,
>  I used the Emacs customisation dialogue to set ess-rterm-version-paths from 
> C:/Program Files/R/R-4.2.2/bin/x64/Rterm.exe to C:/Program 
> Files/R/R-4.3.1/bin/x64/Rterm.exe. After that, the variable 
> ess-r-runner-prefixes, as well as ess-r-versions resolves to ("R-1" "R-2" 
> "R-3" "R-4" "R-5" "R-6" "R-7" "R-devel" "R-patched"), and both M-x R and M-x 
> R-newest will start R 4.2.2. The variable ess-r-versions-created resolves to 
> (R-4.2.2-64bit), as does its alias ess-r-created-runners. Neither of these is 
> customizable in the Emacs dialog.
>
> Is there a way to proceed to notify ESS about the new version installed? 
> RStudio opened a miniscule dialog window indicating that it detected 
> conflicting versions and had me choose one of them.
>
> Thanks for any hint.
>
>
>
> Dr. Johannes Hüsing
> Epidemiologie
>
> Landeskrebsregister NRW gGmbH
> Gesundheitscampus 10
> 44801 Bochum
>
>
>
> T 0234 54509-216
> F 0234 54509-499
> johannes.hues...@krebsregister.nrw.de
> www.landeskrebsregister.nrw
>
> Das Landeskrebsregister NRW online
> FACEBOOK: 
> www.facebook.com/LKR.NordrheinWestfalen
> INSTAGRAM: https://www.instagram.com/landeskrebsregister_nrw
> NEWSLETTER: https://www.landeskrebsregister.nrw/aktuelles/newsletter
>
>
> Geschäftsführer
> Dr. Andres Schützendübel
> Vorsitzender der Gesellschafterversammlung
> Staatssekretär Matthias Heidmeier
> Sitz der Gesellschaft
> Bochum
> Registergericht
> Amtsgericht Bochum
> HRB 17715
>
> HINWEIS: Diese Nachricht ist nur für den Adressaten bestimmt. Es ist nicht 
> erlaubt, diese Nachricht zu kopieren oder Dritten zugänglich zu machen. 
> Sollten Sie irrtümlich diese Nachricht erhalten haben, bitte ich um Ihre 
> Mitteilung per E-Mail oder unter der oben angegebenen Telefonnummer.
>
> [[alternative HTML version deleted]]
>
> __
> ESS-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help

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