Description Usage Arguments Details Value Note Author(s) See Also Examples
View source: R/proftools-GUI.R
Launches a GUI widget with interactive profiling tools for Rprof output, .R files, and R code.
1 2 3 |
pd |
profile data as returned by |
method |
character; use gwidgets view or shiny. |
value |
character; show result as percentage, time, or hits. |
self |
logical; include self cost or not. |
gc |
logical; include GC information or not. |
memory |
logical; include memory information or not. |
srclines |
logical; include source information, if available, or not. |
All the arguments can be altered from within the UI, thus specifying them when calling the function is not necessary. Furthermore, the File menu in the gWidgets view can be used to select another stack file, to select and profile an R file, or to profile some R code.
Source annotation will not be shown if the widget can't find the source files, thus it is crucial to make sure the working directory is inline with the source file paths given in the stack file.
Clicking a function will show source annotations if line information is available. If not, an attempt will be made to show the function definition from the source files. If that also can't be found, a final attempt will be made to show annotation for the first callee for which annotation is available.
No value is returned
If the stack file contains the source filenames only, without their full paths, then the source files should be in the working directory, otherwise no source annotation will be shown because the widget can't find the source files.
Riad Jarjour
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ## Not run:
library(proftools)
library(gWidgets2)
library(gWidgets2RGtk2)
library(shiny)
## Read the profile data from the stack file
pd <- readProfileData(system.file("samples", "Rprof-lmfit-mem.out", package = "proftoolsGUI"))
## Start the GUI using shiny
proftoolsGUI(pd, method = "shiny", value = "pct", gc=TRUE, self= FALSE, memory=TRUE)
## Start the GUI using gWidgets
proftoolsGUI(pd, method = "gwidgets", value = "pct", gc=TRUE, self= FALSE, memory=TRUE)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.