Learn R Programming

proffer (version 0.1.6)

record_pprof: Profile R code and record pprof samples.

Description

Run R code and record pprof samples. Profiles are recorded with record_rprof() and then converted with to_pprof().

Usage

record_pprof(expr, pprof = tempfile(), ...)

Value

Path to a file with pprof samples.

Arguments

expr

An R expression to profile.

pprof

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

...

Additional arguments passed on to Rprof() via record_rprof().

Examples

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

Run the code above in your browser using DataLab