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")) {
            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 June 30, 2024, 1:07 a.m.