tests/faster-subsequent-times.R

local({
    FILE.R <- tempfile(fileext = ".R")
    on.exit(unlink(FILE.R), add = TRUE)
    this.path:::.writeCode(file = FILE.R, {
        if (requireNamespace("microbenchmark", quietly = TRUE)) {
            print(this.path:::.faster_subsequent_times_test())
        } else cat("\n'package:microbenchmark' is not available :(\n")
    })
    cat("\n")
    this.path:::.Rscript(c(
        "--default-packages=NULL", "--no-save", FILE.R
    ))


    cat("\n> source(FILE.R, chdir = FALSE)\n")
    source(FILE.R, chdir = FALSE)


    cat("\n> source(FILE.R, chdir = TRUE)\n")
    source(FILE.R, chdir = TRUE)
})

Try the this.path package in your browser

Any scripts or data that you put into this service are public.

this.path documentation built on Nov. 7, 2025, 5:07 p.m.