
Reset search path of current R session
reset_path.RdThis function is used to detach packages that have been added by a student script.
Arguments
- old_path
A character vector of package namespaces. This is usually the output of
search, run before an R script or Rmd file is rendered, which could cause the search path to change.
Value
There is no object returned. This function is called for it's side- effect of altering the search path.
Details
When a student script is rendered using render_one,
new packages might be added to the search path. These may conflict with the
instructors' search path order, or with subsequent runs of
render_one on students. Hence there is a need to reset the
search path before this is done.
This function does not unload namespaces. It only detaches them from the search path. For a difference between the two, please see Hadley's page.
Examples
opath <- search()
# Load a package
reset_path(opath)