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", "--vanilla", 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 April 11, 2025, 6:19 p.m.