Idea: Global Option to set RStudio to autopopulate package::function when you auto finish the function

I'm sure this has been brought up before, but no idea how I would search for it. I've been told it's a best practice to use the format "package::function" when calling a non-base R function for a script you'll be sharing. I just think it would be a nice feature to have the ability to automate this if you so choose. So, when I start typing "sele" and have the option to auto-finish typing "select", it would also be nice to populate "dplyr::select" if I have the option turned on. This would only occur with auto finish, and not anytime I called select.

Thank you,
John

My first thought is this would be a terrible idea, since it would be non-trivial for R to know which package you want a specific function to come from. But, since the forum was down for a day the idea had some time to percolate in my brain.

I could see this as an interesting (and perhaps useful to some) idea if it were assigned to a new keybinding like Shift+Tab.

In the meantime, there is a useful package: prefixer

The package includes an add-in with a Shiny widget which will go through an active file and let you prefix or not prefix things as you go.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.