set_example_safe_dir: Functions to use an example data directory for package...

View source: R/index.R

set_example_safe_dirR Documentation

Functions to use an example data directory for package examples


The documentation of safedata includes code examples using a data directory. A zipped example directory is included in the package files (data/ but package code must not write within the package structure. The set_example_safe_dir function is used in code examples to unpack this example directory into a temporary folder and set it for use in the example code. The function unset_example_safe_dir is then used to restore any existing data directory set by the user. The example directory should only be created once per session.





The set_example_safe_dir function returns the path of the example directory invisibly.


  • unset_example_safe_dir: Restores a user data directory after running an code example.

See Also


safedata documentation built on April 25, 2022, 5:05 p.m.