new_file | R Documentation |
A convience wrapper around 'fs::file_create()' and 'fs::file_copy()' to create new files, and (defaultly) open them in an editor.
new_file(
path,
open = TRUE,
template = NULL,
create_dir = TRUE,
overwrite = NULL
)
path |
Path of the file to create. |
open |
If 'TRUE' (the default) open the file. |
template |
A template file to copy. |
create_dir |
If 'TRUE' (the default) will create missing directories. |
overwrite |
When 'NULL' (the default) will warn and prompt the user if attempting to overwrite, set to 'TRUE' to force overwrite or 'FALSE' to not overwrite. |
This function is a replacement for 'rstudioapi::documentNew()', which only allows you to create files of the type 'r', 'rmarkdown' and 'sql'. Instead, 'new_file()' allows you to create any empty file of any type, or use an existing file as a template, and assuming in an interactive session to open that file in an editor.
The path to the new file (invisibly).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.