Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an Rstudio keyboard shortcut to open up the file that contains the source code to a function you've written?

Tags:

r

rstudio

I have multiple packages of my own making that I usually have loaded into my R sessions, as well as various functions specific to a small project stored in various utils files. Say I know the name of a function but want to open the particular file housing that function, for reading & debugging purposes. In pyCharm, for example, you can just select the name of that function and press ctrl-b. Is there any sort of keyboard shortcut or function to find (and ideally autmatically open) the file / line that contains the definition of my function of interest?

Thanks!

like image 905
Hillary Sanders Avatar asked Jan 08 '23 09:01

Hillary Sanders


1 Answers

If you are within a package then F2 will navigate to the source file of functions defined within that package (it would be nice if you could also go to other packages but that doesn't work yet). You can also use Ctrl+. to do a typeahead search of all functions in the package (and navigate from the list).

like image 160
JJ Allaire Avatar answered Jan 31 '23 06:01

JJ Allaire