
Last chance! 50% off unlimited learning
Sale ends in
Allow profile data to be filtered on several criteria.
filterProfileData(pd, ..., normalize = FALSE, regex = FALSE)
profile data as returned by readProfileData
.
filter specifications is filter = value
form as
described below.
logical; if true the total hit count is set to the total number of hits in the reduced profile data; otherwise the original value is retained.
logical; if true the specifications in select
, and
omit
, and focus
filters are treated as regular
expressions; otherwise exact matches are required.
A reduced profile data structure.
This function can be used to make plots and summaries more readable or relevant by removing functions that are not of direct interest or have low hit counts.
Filters are specified in filter = value
form with value
typically specifying a filter level or argument. Possible filters and
their argument values are:
select
character vector specifying names of functions; call stacks not containing functions matching any of these names are dropped.
omit
character vector specifying names of functions; call stacks containing functions matching any of these names are dropped.
focus
character vector specifying names of functions; call
stacks not containing functions matching any of these names are
dropped, and functions at the bottom of the stack not matching the
focus
specification are dropped.
skip
integer; the number of elements to trim from the bottom of the stacks.
maxdepth
integer; stacks are truncated to have at most
maxdepth
elements.
self.pct
numeric; functions at the bottom of the stacks with self percentages below this value are removed.
total.pct
numeric; functions at the top of the stacks with total percentages below this value are removed.
interval
inter vector of length 2 specifying first and last sample to use.
merge.pct
numeric; functions at the top of the stacks are removed and stack traces merged until each retained trace accounts for at least this percentage of run time.
Rprof
,
summaryRprof
,
flatProfile
,
readProfileData
,
plotProfileCallGraph
,
profileCallGraph2Dot
# NOT RUN {
pd <- readProfileData(system.file("samples", "glmEx.out", package="proftools"))
plotProfileCallGraph(pd)
plotProfileCallGraph(filterProfileData(pd, self.pct = 1))
plotProfileCallGraph(filterProfileData(pd, self.pct = 1, total.pct = 10))
plotProfileCallGraph(filterProfileData(pd, select = "glm", self.pct=1,
total.pct=10))
# }
Run the code above in your browser using DataLab