inst/samples/generate.r

# Code to generate sample Rprof files

a <- function() rnorm(1e7)
b <- function() rnorm(1e7)
c <- function() {
  rnorm(1e7)
  a()
}
d <- function() {
  a()
  b()
  c()
  a()
  return()
}

Rprof("nesting.rprof")
d()
Rprof(NULL)


data(diamonds, package="ggplot2")
library(reshape)

Rprof("reshape.rprof")
dm <- melt(diamonds)
cast(dm, cut + color + clarity ~ variable, mean)
Rprof(NULL)

Try the profr package in your browser

Any scripts or data that you put into this service are public.

profr documentation built on May 29, 2017, 1:39 p.m.