| with_dir | R Documentation |
This is a verbatim copy of withr::with_dir from of withr's
version 2.4.1.
I often need withr only to import withr::with_dir, which is a
really simple function. So I just hijack withr::with_dir.
with_dir(new, code)
new |
The new working directory. |
code |
Code to execute in the temporary working directory. |
The results of the evaluation of the code argument.
Other operating system functions:
clipboard_path(),
file_copy(),
file_save(),
get_boolean_envvar(),
get_run_r_tests(),
is_installed(),
is_r_package_installed(),
is_success(),
is_windows(),
view(),
vim(),
wipe_tempdir()
temp_dir <- file.path(tempfile())
dir.create(temp_dir)
with_dir(temp_dir, getwd())
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.