Code
X = c(NA, 12, -15, 14, 18)
fn_Mean(X, na.rm = TRUE)
In the RStudio environment, you can use breakpoint to jump to a particular location as an alternative to using the browser
function.
Set an editor breakpoint by clicking to the left of the line number in the source file (or Shift+F9
with curson on the line).
Source the script if required.
Once in the browser mode, move around the function as mentioned before.
One advantage is that you do not need to delete the line including browser()
as before.
You can also put a breakpoint
within a function and investigate each step of the execution, even if the function does not run into any errors.
X = c(NA, 12, -15, 14, 18)
fn_Mean(X, na.rm = TRUE)