[ESS] how to deal with underscore in ggplot2 etc
Hello ESS users, Please, tell me how do you deal with the proliferation of functions that use the underscore symbol? My biggest concern is using ggplot2 where all the geom functions have an underscore: geom_smooth etc?the package is authored by the people behind Rstudio who do not care about ESS users, but many other packages now employ the underscore heavily.Is there a package/function that can rename all functions in a package by replacing the underscore with a dot: geom_smooth becomes geom.smooth??is there any interest by the ESS developers to create such a package/function?I apologize if this has been discussed, but I cannot find a search field in the archives.CheersStephen [[alternative HTML version deleted]] __ ESS-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/ess-help
Re: [ESS] how to deal with underscore in ggplot2 etc
I disable the underscore behavior in ESS. (setq ess-smart-S-assign-key nil) If you like the underscore behavior, maybe remap the function to another key. Best, John On Fri, Sep 4, 2020, at 9:33 AM, Stephen Bond via ESS-help wrote: > Hello ESS users, > Please, tell me how do you deal with the proliferation of functions > that use the underscore symbol? My biggest concern is using ggplot2 > where all the geom functions have an underscore: geom_smooth etc?the > package is authored by the people behind Rstudio who do not care about > ESS users, but many other packages now employ the underscore heavily.Is > there a package/function that can rename all functions in a package by > replacing the underscore with a dot: geom_smooth becomes > geom.smooth??is there any interest by the ESS developers to create such > a package/function?I apologize if this has been discussed, but I cannot > find a search field in the archives.CheersStephen > > [[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] how to deal with underscore in ggplot2 etc
This is a bit irritating, isn't it! You might not know that on ESS you can toggle between '<-' and '_' by pressing the underscore key twice. That's the quickest fix, and the one I use. I frequently find myself cursing to myself when I do this :) You could probably use a different key to insert the '<-' symbol, but after many years with ESS that would feel odd. Best, Tyler -- plantarum.ca On Fri, Sep 4, 2020, at 9:33 AM, Stephen Bond via ESS-help wrote: > Hello ESS users, > Please, tell me how do you deal with the proliferation of functions > that use the underscore symbol? My biggest concern is using ggplot2 > where all the geom functions have an underscore: geom_smooth etc?the > package is authored by the people behind Rstudio who do not care about > ESS users, but many other packages now employ the underscore heavily.Is > there a package/function that can rename all functions in a package by > replacing the underscore with a dot: geom_smooth becomes > geom.smooth??is there any interest by the ESS developers to create such > a package/function?I apologize if this has been discussed, but I cannot > find a search field in the archives.CheersStephen > > [[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] how to deal with underscore in ggplot2 etc
Hello, > My biggest concern is using ggplot2 > where all the geom functions have an underscore: geom_smooth etc?the > package is authored by the people behind Rstudio who do not care about > ESS users If you tweak ggplots for hours every key stroke saved counts. Here is my work flow. First I remove this smart underscore entirely as it is not so smart. (setq ess-smart-S-assign-key nil) Then I created a dumb one (defun dumb-assign () (interactive) (insert " <- ")) Then to avoid putting too much strain on my muscle memory I use the key-chord package on melpa. You can find more information [1] here. So my pressing -= together very quickly, I have the assign key and the fingers go at the same place. (key-chord-define ess-r-mode-map "-=" 'dumb-assign) I have been struggling with the naming convention with R for a long time. At some point I considered leaning towards a more lispy way `test-fun` <- function(s) print(s) but it would not have been very popular. I now think [2] Camelcase is the way to go. [1]: http://irreal.org/blog/?p=344 [2] https://jef.works/R-style-guide/ Hope this helps, Jeremie Juste __ ESS-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/ess-help
Re: [ESS] how to deal with underscore in ggplot2 etc
In the next version of ESS the underscore will no longer insert assignment by default. Instead you can use `ess-cycle-assign` with the `C-c C-=` binding. This cycles through all assign ops on repeated presses. To get the previous behaviour, you'll need to opt in by binding "_" to `ess-insert-assign` in your config. This now works with any key of your choice. If binded to ";" for instance, one press will insert assignment, a second press will insert ";". Best, Lionel On 9/4/20, Jeremie Juste via ESS-help wrote: > > Hello, > >> My biggest concern is using ggplot2 >> where all the geom functions have an underscore: geom_smooth etc?the >> package is authored by the people behind Rstudio who do not care about >> ESS users > > If you tweak ggplots for hours every key stroke saved counts. > > Here is my work flow. First I remove this smart underscore entirely as > it is not so smart. > > (setq ess-smart-S-assign-key nil) > > Then I created a dumb one > > (defun dumb-assign () > (interactive) > (insert " <- ")) > > Then to avoid putting too much strain on my muscle memory I use the > key-chord > package on melpa. You can find more information [1] here. So my pressing > -= together very quickly, I have the assign key and the fingers go at > the same place. > > (key-chord-define ess-r-mode-map "-=" 'dumb-assign) > > I have been struggling with the naming convention with R for a long > time. At some point I considered leaning towards a more lispy way > > `test-fun` <- function(s) print(s) but it would not have been very > popular. I now think [2] Camelcase is the way to go. > > [1]: http://irreal.org/blog/?p=344 > [2] https://jef.works/R-style-guide/ > > Hope this helps, > > Jeremie Juste > > __ > 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