Displaying 1 result from an estimated 1 matches for "knittr".
Did you mean:
knitr
2012 Oct 30
1
print and execute functions in a package namespace
...hich
produces a plot, and perhaps some printed output, e.g.,
fig1 <- function() plot(1:10)
fig2 <- function() plot(10:1)
fig3 <- function() {y<-sample(1:10,10); plot(y); y}
I'd like to produce a document (PDF or HTML) containing the listing of
each function and its output,
using knittr.
I can execute a list of figures using something like
# print and run a figure function
onefig <- function(fig) {
cat("Figure:") # how to get name of fig function?
print(fig)
fig()
}
lapply(list(fig1, fig2, fig3), onefig)
But I need to work with the names of the figu...