Skip to content
Prev 200017 / 398506 Next

Sweave() within a function: objects not found

Dear Duncan,

many thanks for your swift reply and pointers.
sure.
Right, this is ordinarily the way I proceed, too. But, now, I would like to include "ready-made" Sweave reports in a package, e.g. /inst/reports/template1.Rnw, and provide a function, say reportgen(), with which a user can be provide his objects that are then used within the Sweave file(s).

But if you
Having said the above, I think that this will be the route to take and indeed in RweaveEvalWithOpt is the line:

res <- try(withVisible(eval(expr, .GlobalEnv)), silent = TRUE)

which needs to be adjusted.

Best,
Bernhard