Two days ago I misspelled
geom_Boxplot), had to look for a
%>% next to it, and fumble with the brackets.
Don't repeat yourself
Got a bit carried away over the weekend making a few quality of life functions in an addin package.
Package currently includes
- Automatic switching between
1 key press for both
+bound to a shortcut. Which operator is inserted changes based on context in R script, and happens behind the scenes when constructing functions. Example: when inserting a plot function, a check verifies that the pipe operator is set correctly.
- Indented pipe operator shortcut (tidyverse styleguide)
- Shortcuts for inserting dplyr verbs.
A nice shortcut layout is very pleasant. Example: in gif below, I use ctrl+shift+s for
select, and ctrl+shift+1 for the helper
starts_with, ctrl+shift+f for
filter, ctrl+shift+m for
mutate, and so on. Which keys to bind shortcuts to, is the users' choice.
- Constructor methods to assemble and insert most tidyverse functions through 1-4 letter abbreviations.
Currently methods are included for tidyr, ggplot2, forcats, readr, clock, recipes and parsnip packages.
Conveniently, these shortcuts allow to predict when to switch to other pipe operator and where to place the cursor.
- Wrapper method to call any constructor method
This allows most tidyverse functions to be constructed and inserted via 1 dialog box, even though many share similar first, second letters. For example,
2sdin dialog box returns stringr's
is_year_month_day(). In the gif, I use it by hitting ctrl+shift+/.
Here's a sneak preview with white box displaying button presses
Given, it is cherrypicked, but it shows the possible input speed and convenience. Doesn't seem like much, but that is roughly 190 key presses if fully typed, currently reduced to about 90 buttons presses, while much less distracted by syntax, pipe operator and browsing through autocompletion lists. Snippets are cool, but try making couple hundred of those for functions like
Now the hardest part of package development.. a name. Could you help?
inspiration drawn from packages
mufflr, both packages aimed at making R experience speedier.
device that increases an engines power output by forcing extra compressed air into the combustion chamber.
It says on the box. Bit boring, but to the point
Nod to function name suggestion in a poll, when Hadley Wickham asked to describe what
pivot_longer does compared to
Should put a
+ not a
gives me this vibe
a person [or thing??] who is excessively concerned with minor details
This is an addin package, meaning there no need to use
library to access its functions. Shortcuts available on opening RStudio. Key is to not use a package name that others might want to use later.
Have a function request or bright idea? Want to collaborate? Send a pm
By the way, is there a name for
%>% is the pipe,
+ is ....?