One of my all-time favorite R packages is Miles McBain's breakerofchains.
You can put your cursor anywhere in a piped command, run a keyboard shortcut, and RStudio will run everything up to the current line. This prevents so much time highlighting up to a point and running partial pipeline code.
Does anything like this exist for Positron?
E.g., if the cursor is anywhere on the select() line, the keyboard shortcut will run up to the select, but not the summarise or after.
library(tidyverse)
star_plot <-
starwars %>%
group_by(species) %>%
select(height, mass) %>% ### putting the cursor here will stop after the select()
summarise(
height = mean(height, na.rm = TRUE),
mass = mean(mass, na.rm = TRUE)
) %>%
ggplot(aes(x = height, y = mass)) +
geom_point()
I believe this package should work well in Positron, because we support all the rstudioapi functions that are used. You would need to set up a custom keyboard shortcut something like this:
I'd also like to give an honorable mention to a feature called Selection Range, which is bound to Ctrl + Shift + Right to "expand" and Ctrl + Shift + Left to "shrink" on a Mac by default.
You select a range and then Cmd + Enter to send it to the console
It is quite useful as a native breakerofchains feature!