Learn R Programming

proffer (version 0.1.6)

record_rprof: Profile R code and record Rprof samples.

Description

Run R code and record Rprof samples.

Usage

record_rprof(expr, rprof = tempfile(), ...)

Value

Path to a file with Rprof samples.

Arguments

expr

An R expression to profile.

rprof

Path to a file with Rprof samples. Also returned from the function.

...

Additional arguments passed on to Rprof().

Examples

Run this code
if (identical(Sys.getenv("PROFFER_EXAMPLES"), "true")) {
# Returns a path to Rprof samples.
record_rprof(replicate(1e2, sample.int(1e4)))
}

Run the code above in your browser using DataLab