Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/r-lib/profvis
Visualize R profiling data
https://github.com/r-lib/profvis
Last synced: 3 months ago
JSON representation
Visualize R profiling data
- Host: GitHub
- URL: https://github.com/r-lib/profvis
- Owner: r-lib
- License: other
- Created: 2015-09-18T18:01:49.000Z (about 9 years ago)
- Default Branch: main
- Last Pushed: 2024-07-12T06:54:39.000Z (4 months ago)
- Last Synced: 2024-08-01T07:48:11.882Z (3 months ago)
- Language: JavaScript
- Homepage: http://r-lib.github.io/profvis/
- Size: 6.69 MB
- Stars: 296
- Watchers: 54
- Forks: 38
- Open Issues: 37
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-shiny-extensions - profvis - Interactive visualizations for profiling R code. [Profiling Shiny apps](https://profvis.r-lib.org/examples.html#example-3---profiling-a-shiny-application). (Developer Tools / Profiling)
README
profvis
=======[![R-CMD-check](https://github.com/r-lib/profvis/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/r-lib/profvis/actions/workflows/R-CMD-check.yaml)
[![Codecov test coverage](https://codecov.io/gh/r-lib/profvis/graph/badge.svg)](https://codecov.io/gh/r-lib/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
```R
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.
```R
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](http://www.htmlwidgets.org/), 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.
```R
p <- profvis(f())# View it with:
p
# or print(p)
```