reset_path {autoharp}R Documentation

Reset search path of current R session

Description

This function is used to detach packages that have been added by a student script.

Usage

reset_path(old_path)

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.

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.

Value

There is no object returned. This function is called for it's side- effect of altering the search path.

Examples

opath <- search()
# Load a package
reset_path(opath)

[Package autoharp version 0.0.8 Index]