Learn R Programming

profvis

profvis is a tool for visualizing code profiling data from R. It creates a web page which provides a graphical interface for exploring the data.

Installation

install.packages("profvis")

Example

To run code with profiling, wrap the expression in profvis(). By default, this will result in the interactive profile visualizer opening in a web browser.

library(profvis)

f <- function() {
  pause(0.1)
  g()
  h()
}
g <- function() {
  pause(0.1)
  h()
}
h <- function() {
  pause(0.1)
}

profvis(f())

The profvis() call returns an htmlwidget, which by default when printed opens a web browser. If you wish to save the object, it won't open the browser at first, but you can view it later by typing the variable name at the console, or calling print() on it.

p <- profvis(f())

# View it with:
p
# or print(p)

Copy Link

Version

Install

install.packages('profvis')

Monthly Downloads

174,733

Version

0.4.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

September 20th, 2024

Functions in profvis (0.4.0)

profvis

Profile an R expression and visualize profiling data
parse_rprof

Parse Rprof output file for use with profvis
print.profvis

Print a profvis object
profvis_ui

profvis UI for Shiny Apps
pause

Pause an R process
profvisOutput

Widget output and renders functions for use in Shiny
profvis-package

profvis: Interactive Visualizations for Profiling R Code