script_file | R Documentation |
Determine the directory or full path to the currently executing script
script_file(fail = c("stop", "warning", "quiet"))
script_path(fail = c("stop", "warning", "quiet"))
fail |
character, one of "stop", "warning", "quiet". specifying what should be done when the script path cannot be determined: "stop" causes an error to be generated, "warn" generates a warning message and returns NA, "quiet" silently returns NA. These function should work with |
A character scalar containing the full path to the currently
executing script file (script_file
) or its directory
(script_path
). If unable to determine the script path, it generates
a warning and returns ""
(empty string).
script_file()
: Determine the full path of the currently executing
script
script_path()
: Determine the directory of the currently executing script
Greg Warnes greg@warnes.net based on on a Stack Overflow post by jerry-t (https://stackoverflow.com/users/2292993/jerry-t) at https://stackoverflow.com/a/36777602/2744062.
getwd()
commandArgs(trailingOnly = FALSE)
script_file("warning")
script_path("warning")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.