benchplot: Benchmark plot creation time. Broken down into construct,...

Description Usage Arguments Examples

View source: R/bench.r

Description

Benchmark plot creation time. Broken down into construct, build, render and draw times.

Usage

1

Arguments

x

code to create ggplot2 plot

Examples

1
2
3
4
5
6
benchplot(ggplot(mtcars, aes(mpg, wt)) + geom_point())
benchplot(ggplot(mtcars, aes(mpg, wt)) + geom_point() + facet_grid(. ~ cyl))

# With tidy eval:
p <- expr(ggplot(mtcars, aes(mpg, wt)) + geom_point())
benchplot(!!p)

Example output

       step user.self sys.self elapsed
1 construct     0.023    0.004   0.026
2     build     0.189    0.012   0.202
3    render     0.273    0.004   0.283
4      draw     0.061    0.001   0.061
5     TOTAL     0.546    0.021   0.572
       step user.self sys.self elapsed
1 construct     0.048    0.000   0.048
2     build     0.397    0.012   0.412
3    render     0.401    0.000   0.404
4      draw     0.081    0.000   0.081
5     TOTAL     0.927    0.012   0.945
       step user.self sys.self elapsed
1 construct     0.003        0   0.003
2     build     0.016        0   0.017
3    render     0.053        0   0.053
4      draw     0.053        0   0.053
5     TOTAL     0.125        0   0.126

ggplot2 documentation built on June 25, 2021, 5:06 p.m.