Remember that when creating a new project, this will give you a fresh R session. Make sure to save all files before creating or switching projects.
Create a new project from the Project Menu. Choose from “Existing Directory” and select the R-2.15.1 directory saved inside the rstudioTraining directory. This will start a new project with the source code from R.
By default, your project is indexed based on the root directory of the project. This allows you to utalize code navigation to jump between functions and files. If necessary, this option can be toggled off inside of your project level options. Note though this no longer allows you to quickly navigate your code using RStudio's code navigation features.
Use the Go to file/function feature at the top of the IDE and search for “toH”. You'll see some options are filtered and we're looking for the “toHTML.R” file. Select this to open it directly. Notice this file is burried in the source code and we might not have known where it was.
At the bottom of the source editor is the function tree/menu which shows all the funcitons inside of this script. Select it to navigate from function to another. Open the “makeHelpTable” function from the function tree. It will jump to this location.
Part of the “makeHelpTable” function has the following commands:
pkg <- help[,"Package"]
root <- paste0(paste(rep.int("../", depth), collapse=""),
"library/", pkg, "/html/")
If we don't know what the paste0 command is doing, we can view the source for this command. Place your curosr on this command and press F2 (or use the code menu at the top and select Go to Function Definition. It will automatically open up the file (if it is in your project) or just view the source code (if it is not in your project).
Go back to the top menu for “Go to file/function” and enter “make”. You'll see different types of files. These are .R scripts, functions inside of R scripts and others. Look for the “makeVignetteTable”. This is a function and clicking it opens directly to that location.
Open yet another file “rank” and you have at least two files in the eiditor. Use the back and forward buttons to navigate to previous locations in your source editor.