proftoolsGUI: Start Widget for proftools-GUI

Description Usage Arguments Details Value Note Author(s) See Also Examples

View source: R/proftools-GUI.R

Description

Launches a GUI widget with interactive profiling tools for Rprof output, .R files, and R code.

Usage

1
2
3
proftoolsGUI(pd = NULL, method = c("gwidgets", "shiny"),
             value = c("pct", "time", "hits"), self = FALSE, 
             gc = TRUE, memory = FALSE, srclines = TRUE)

Arguments

pd

profile data as returned by readProfileData.

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.

Details

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.

Value

No value is returned

Note

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.

Author(s)

Riad Jarjour

See Also

Rprof, readProfileData,

Examples

 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)

ltierney/Rpkg-proftools-GUI documentation built on May 21, 2019, 8:41 a.m.