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: 4 days 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-09-20T17:25:32.000Z (3 months ago)
- Last Synced: 2024-09-21T14:06:54.236Z (3 months ago)
- Language: JavaScript
- Homepage: https://profvis.r-lib.org/
- Size: 7.35 MB
- Stars: 301
- Watchers: 50
- Forks: 39
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- Changelog: NEWS.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://app.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)
```