Description Usage Arguments Value Examples
Light wrapper around the aprof function
1 | aprofWrapper(expr, sourceFile)
|
expr |
Expression to profile |
sourceFile |
The file with the source code to be profiled |
An aprof object
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | # The function to profile
f = function(n, sim) {
# Simulate some data
x = rnorm(n, mean = 0, sd = 2)
t = data.frame(x)
for (i in 1:sim) {
y = x + rnorm(x, mean = 0, sd = 0.5)
t = cbind(t, y)
}
return(t)
}
# Dump the function to a tmp file
mySourceFile = tempfile()
dump("f", file = mySourceFile)
# Profile
prof = aprofWrapper(f(100, 100), mySourceFile)
# Visualise
viewProfHtml(prof)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.