[R] Sweave, SweaveHooks and printing the label

2011-04-16 Thread David.Epstein
I would like to print the label of each code chunk, just before printing the code chunk itself. Is that possible using SweaveHooks, or by some other mechanism? Thanks David -- View this message in context:

Re: [R] Sweave, SweaveHooks and printing the label

2011-04-16 Thread Yihui Xie
Hi, I think you can search in the parent environments by brutal force like this (I don't guarantee it works for all Sweave documents): if ((n.parents - length(sys.parents())) = 3) { for (i in seq_len(n.parents) - 1) { if ('chunkopts' %in% ls(envir = sys.frame(i))) {