Re: [ESS] Ess does not find path to user packages
I'm with Fer here. I'm afraid I don't see the point in telling ESS about personal libraries. This thread taught me it is possible in the first place, even after 20+ years using ESS. ;-) The important thing appears to tell R about personal libraries, so that what works inside Emacs+ESS will also work elsewhere. Honest question: what do you guys use ess-r-package-library-paths for? v. Vincent Goulet Professeur titulaire École d'actuariat, Université Laval > Le 9 févr. 2025 à 16:25, Fer via ESS-help a écrit : > > I think you should tell it directly to R too? > > At least is how I do it, setting it in the .Renviron file with > > R_LIBS_USER='~/myPath' > > cheers > > Fer > > On 2/8/25 07:30, Naresh Gurbuxani via ESS-help wrote: >> In my init.el file, I have defined a path for personal packages. >> >> (use-package ess >> :defer t >> :config >> (require 'ess-r-mode) >> ;; many lines omitted >> (setq ess-r-package-library-paths >> (append ess-r-package-library-paths >> '("/Users/nareshgurbuxani/Documents/statProgram/packages"))) >> ) >> >> In a new emacs session, R does not find this path. Below is my R session. >>> install.packages("linmod_1.0.tar.gz", repos = NULL) >> Warning in install.packages("linmod_1.0.tar.gz", repos = NULL) : >> 'lib = >> "/opt/local/Library/Frameworks/R.framework/Versions/4.4/Resources/library"' >> is not writable >> Would you like to use a personal library instead? (yes/No/cancel) cancel >> Error in install.packages("linmod_1.0.tar.gz", repos = NULL) : >> unable to install packages >> >> Why does R not see the additional path defined above? >> >> Thanks, >> Naresh >> __ >> ESS-help@r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/ess-help > [[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] Ess does not find path to user packages
I think you should tell it directly to R too? At least is how I do it, setting it in the .Renviron file with R_LIBS_USER='~/myPath' cheers Fer On 2/8/25 07:30, Naresh Gurbuxani via ESS-help wrote: > In my init.el file, I have defined a path for personal packages. > > (use-package ess >:defer t >:config >(require 'ess-r-mode) > ;; many lines omitted >(setq ess-r-package-library-paths > (append ess-r-package-library-paths > '("/Users/nareshgurbuxani/Documents/statProgram/packages"))) >) > > In a new emacs session, R does not find this path. Below is my R session. >> install.packages("linmod_1.0.tar.gz", repos = NULL) > Warning in install.packages("linmod_1.0.tar.gz", repos = NULL) : >'lib = > "/opt/local/Library/Frameworks/R.framework/Versions/4.4/Resources/library"' > is not writable > Would you like to use a personal library instead? (yes/No/cancel) cancel > Error in install.packages("linmod_1.0.tar.gz", repos = NULL) : >unable to install packages > > Why does R not see the additional path defined above? > > Thanks, > Naresh > __ > ESS-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/ess-help [[alternative HTML version deleted]] __ ESS-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/ess-help
Re: [ESS] Ess does not find path to user packages
Correct. ESS does not configure R so to speak. Thanks -- Rodney Sparapani, Associate Professor of Biostatistics, He/Him President, Wisconsin Chapter of the American Statistical Association Division of Biostatistics, Data Science Institute Medical College of Wisconsin, Milwaukee Campus From: Naresh Gurbuxani Date: Saturday, February 8, 2025 at 9:38 AM To: Sparapani, Rodney Subject: Re: [ESS] Ess does not find path to user packages ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. Thanks for explaining. To check my understanding, ess variable ess-r-package-library-paths is not meant to be used for defining paths to load packages from personal library. It is best to define these paths in .Rprofile using .libPaths() function. Thanks again for your patience On Feb 8, 2025, at 10:32 AM, Sparapani, Rodney wrote: As it states in the documentation…. ess-r-package-library-paths is a variable defined in ‘ess-r-package.el’. Its value is nil Default path to find user packages. Can be either a string specifying a directory or a list of directories. This variable is also consulted by ‘xref-find-definitions’ in R buffers. See ‘ess-r-xref-backend’. -- Rodney Sparapani, Associate Professor of Biostatistics, He/Him President, Wisconsin Chapter of the American Statistical Association Division of Biostatistics, Data Science Institute Medical College of Wisconsin, Milwaukee Campus From: Naresh Gurbuxani mailto:naresh_gurbux...@hotmail.com>> Date: Saturday, February 8, 2025 at 9:27 AM To: Naresh Gurbuxani mailto:naresh_gurbux...@hotmail.com>> Cc: Sparapani, Rodney mailto:rspar...@mcw.edu>> Subject: Re: [ESS] Ess does not find path to user packages ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. After adding this directory in .Rprofile (using .libPaths()), I can load library from this path. If I just wanted to load my personal packages, I can do that without updating init.el file by setting a value to ess-r-package-library-paths. What is the use of the variable ess-r-package-library-paths? > On Feb 8, 2025, at 10:16 AM, Naresh Gurbuxani via ESS-help > mailto:ess-help@r-project.org>> wrote: > > .libPaths() does not see the new directory added. > > !> .libPaths() > [1] "/opt/local/Library/Frameworks/R.framework/Versions/4.4/Resources/library” > > In my .Rprofile, I can include the new directory in .libPaths(). But then, > why do I need to update my init.el file also? > >> On Feb 8, 2025, at 10:10 AM, Sparapani, Rodney via ESS-help >> mailto:ess-help@r-project.org>> wrote: >> >> Hi Naresh: >> >> What does .libPaths() show for you? >> >> For me, � >>> .libPaths() >> [1] "/home/rsparapa/R/4.3.1/lib64/R/library" >> [2] "/usr/local/R/4.3.1/lib64/R/library" >> >> So for me, I think, it should be set like this� >> (setq ess-r-package-library-paths "/home/rsparapa/R/4.3.1/lib64/R/library") >> >> Of course, R needs to know about this too. In my ~/.Rprofile I have� >> .libPaths('~/R/4.3.1/lib64/R/library') >> -- >> Rodney Sparapani, Associate Professor of Biostatistics, He/Him >> President, Wisconsin Chapter of the American Statistical Association >> Division of Biostatistics, Data Science Institute >> Medical College of Wisconsin, Milwaukee Campus >> >> >> [[alternative HTML version deleted]] >> >> __ >> ESS-help@r-project.org<mailto:ESS-help@r-project.org> mailing list >> https://urldefense.com/v3/__https://stat.ethz.ch/mailman/listinfo/ess-help__;!!H8mHWRdzp34!5Y4GPURVDl82rRI2TKi6iR3Yb1b-LToftkZkeYw27qiJcg7dIv-JZySNyCo6Apvb5eijgj3zHB0HUPRSvRMUF2gRwRsh$<https://urldefense.com/v3/__https:/stat.ethz.ch/mailman/listinfo/ess-help__;!!H8mHWRdzp34!5Y4GPURVDl82rRI2TKi6iR3Yb1b-LToftkZkeYw27qiJcg7dIv-JZySNyCo6Apvb5eijgj3zHB0HUPRSvRMUF2gRwRsh$> > > __ > ESS-help@r-project.org<mailto:ESS-help@r-project.org> mailing list > https://urldefense.com/v3/__https://stat.ethz.ch/mailman/listinfo/ess-help__;!!H8mHWRdzp34!5Y4GPURVDl82rRI2TKi6iR3Yb1b-LToftkZkeYw27qiJcg7dIv-JZySNyCo6Apvb5eijgj3zHB0HUPRSvRMUF2gRwRsh$<https://urldefense.com/v3/__https:/stat.ethz.ch/mailman/listinfo/ess-help__;!!H8mHWRdzp34!5Y4GPURVDl82rRI2TKi6iR3Yb1b-LToftkZkeYw27qiJcg7dIv-JZySNyCo6Apvb5eijgj3zHB0HUPRSvRMUF2gRwRsh$> [[alternative HTML version deleted]] __ ESS-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/ess-help
Re: [ESS] Ess does not find path to user packages
Because ESS does not query .libPaths(). In your case, that wouldn’t work anyways since you don't have a personal library according to the output below. -- Rodney Sparapani, Associate Professor of Biostatistics, He/Him President, Wisconsin Chapter of the American Statistical Association Division of Biostatistics, Data Science Institute Medical College of Wisconsin, Milwaukee Campus From: Naresh Gurbuxani Date: Saturday, February 8, 2025 at 9:16 AM To: Sparapani, Rodney Cc: ess-help@r-project.org Subject: Re: [ESS] Ess does not find path to user packages ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. .libPaths() does not see the new directory added. !> .libPaths() [1] "/opt/local/Library/Frameworks/R.framework/Versions/4.4/Resources/library” In my .Rprofile, I can include the new directory in .libPaths(). But then, why do I need to update my init.el file also? > On Feb 8, 2025, at 10:10 AM, Sparapani, Rodney via ESS-help > wrote: > > Hi Naresh: > > What does .libPaths() show for you? > > For me, � >> .libPaths() > [1] "/home/rsparapa/R/4.3.1/lib64/R/library" > [2] "/usr/local/R/4.3.1/lib64/R/library" > > So for me, I think, it should be set like this� > (setq ess-r-package-library-paths "/home/rsparapa/R/4.3.1/lib64/R/library") > > Of course, R needs to know about this too. In my ~/.Rprofile I have� > .libPaths('~/R/4.3.1/lib64/R/library') > -- > Rodney Sparapani, Associate Professor of Biostatistics, He/Him > President, Wisconsin Chapter of the American Statistical Association > Division of Biostatistics, Data Science Institute > Medical College of Wisconsin, Milwaukee Campus > > > [[alternative HTML version deleted]] > > __ > ESS-help@r-project.org mailing list > https://urldefense.com/v3/__https://stat.ethz.ch/mailman/listinfo/ess-help__;!!H8mHWRdzp34!4ILS4TAqjriO4dBBwZJDfuhWNJALV2MxWhYjg5H8y1Ncgnoq4VKEoxbdFpS1sH1Dc_arMEhxXe6UIwfVfIG97xTCsWHY$<https://urldefense.com/v3/__https:/stat.ethz.ch/mailman/listinfo/ess-help__;!!H8mHWRdzp34!4ILS4TAqjriO4dBBwZJDfuhWNJALV2MxWhYjg5H8y1Ncgnoq4VKEoxbdFpS1sH1Dc_arMEhxXe6UIwfVfIG97xTCsWHY$> [[alternative HTML version deleted]] __ ESS-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/ess-help
Re: [ESS] Ess does not find path to user packages
.libPaths() does not see the new directory added. !> .libPaths() [1] "/opt/local/Library/Frameworks/R.framework/Versions/4.4/Resources/library” In my .Rprofile, I can include the new directory in .libPaths(). But then, why do I need to update my init.el file also? > On Feb 8, 2025, at 10:10 AM, Sparapani, Rodney via ESS-help > wrote: > > Hi Naresh: > > What does .libPaths() show for you? > > For me, � >> .libPaths() > [1] "/home/rsparapa/R/4.3.1/lib64/R/library" > [2] "/usr/local/R/4.3.1/lib64/R/library" > > So for me, I think, it should be set like this� > (setq ess-r-package-library-paths "/home/rsparapa/R/4.3.1/lib64/R/library") > > Of course, R needs to know about this too. In my ~/.Rprofile I have� > .libPaths('~/R/4.3.1/lib64/R/library') > -- > Rodney Sparapani, Associate Professor of Biostatistics, He/Him > President, Wisconsin Chapter of the American Statistical Association > Division of Biostatistics, Data Science Institute > Medical College of Wisconsin, Milwaukee Campus > > > [[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