ask_dir_create | R Documentation |
ask_dir_create( dir = "/path/to/directory", title = "Directory check", preamble_exists_no = c("Directory {.field {dir}} does not exist yet.", "Do you want to create it?"), preamble_exists_yes = c("Directory {.field {dir}} already exists."), implications_yes_addendum = character(), implications_yes = c("Directory {.field {dir}} will be created"), implications_no_addendum = character(), implications_no = c("Nothing ;-)"), step = 0, steps_max = 0, is_interactive = interactive() )
dir |
(character or fs_path) Directory in question. |
title |
(character) Title for this "input block". |
preamble_exists_no |
(character) Preamble text. |
preamble_exists_yes |
(character) Preamble text. |
implications_yes_addendum |
(character) Additional text for the implications preamble text |
implications_yes |
(character) Vector with implications |
implications_no_addendum |
(character) Additional text for the implications preamble text |
implications_no |
(character) Vector with implications |
step |
(integer) Denote which process step this is. See |
steps_max |
(integer) Denote how many process steps there are in
total. See |
is_interactive |
[logical] Interactive mode yes/no |
## Not run: path <- ask_dir_create(dir = fs::path(tempdir(), "a/b/c")) path %>% fs::dir_exists() ask_dir_create(dir = fs::path(tempdir(), "a/b/c")) # Answer with an input of 2 ("No") ask_dir_create(dir = fs::path(tempdir(), "a/b/c")) # Answer with an input of 3 ("Let me start over") ask_dir_create(dir = fs::path(tempdir(), "a/b/c")) # Answer with an input of 4 ("Exit") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.