Skip to content

add sessionInfo() option to "save"

2 messages · Robert M. Flight, Yihui Xie

#
My 2 cents in the last section of this page: http://yihui.name/knitr/demo/cache/

You can set something like opts_knit$set(cache.extra =
sapply(c('boot', 'ggplot2', 'splines'), packageVersion)) so that each
time these packages are updated, the cache of your document will be
rebuilt.

That is not exactly the same as what you mentioned, however, with the
knitr package, you can easily leave a chunk like this in your Rnw
document:

<<sessioninfo, cache=TRUE, include=FALSE>>=
.sessioninfo = sessionInfo()
@

and the variable .sesioninfo will be saved to the cache database,
which you can load into your R session by lazyLoad() and examine it. I
think it might be better than manually save() objects.

Regards,
Yihui
--
Yihui Xie <xieyihui at gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA
On Fri, May 4, 2012 at 11:09 AM, Robert M. Flight <rflight79 at gmail.com> wrote: