Interactive visualizations for profiling R code.
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. Live demo.
install.packages("profvis")
See the documentation site.
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. You can see a live demo here.
library(profvis)library(ggplot2) profvis({ g <- ggplot(diamonds, aes(carat, price)) + geom_point(size = 1, alpha = 0.2) print(g)})
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({ g <- ggplot(diamonds, aes(carat, price)) + geom_point(size = 1, alpha = 0.2) print(g)}) # View it with:p# or print(p)
Fixed #77: The contents of <expr>
are now always listed first.
Addressed #85: The pause()
function is now implemented in C, which reduces the amount of data generated.
Fixed #86: In the data pane, toggling between horizontal/vertical view caused the flame graph to render on top of the tree view.
Fixed #84: In the data pane, leaf nodes (representing top-most calls on the stack) were not displayed.
Addressed #82: In the data pane, if a node has exactly one child, that child will automatically be expanded. This makes it more efficient to explore the data. (#83)
Fixed #50: In the data pane, function calls were shown in reverse order.
Fixed #68: Profvis threw an error when a package was installed using devtools::install_github(args = "--with-keep.source")
.
Fix bug where, when loading a profile that didn't contain memory data, profvis would throw an error. #66
Fixed #73: Profvis would throw an error if used on code sourced from a remote URL.