View source: R/utils_profiling.R
profile_script | R Documentation |
This function will add profiling code to a script wherever the following flags are found in the first non-spacing characters on the line:
#<p
Opening comment flag where profile_open
will be inserted.
#>p
Closing comment flag where profile_close
will be inserted.
profile_script(
.file,
profile_open = utils::Rprof(fs::path(dir_profvis, ext(basename(.file), strip = TRUE),
glue::glue("{.lo}-{.lc}_{file_timestamp()}"), ext = "Rprof"), interval = 0.02,
line.profiling = TRUE, memory.profiling = TRUE),
profile_close = utils::Rprof(NULL),
dir_profvis = "profvis",
remove = FALSE,
new_script = TRUE,
new_filename = paste0(ext(basename(.file), strip = TRUE), "_prof", ext(.file))
)
.file |
path to script |
profile_open |
Default: |
profile_close |
|
dir_profvis |
|
remove |
|
new_script |
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.