Re: [Rd] add sessionInfo() option to "save"

From: Yihui Xie <xie_at_yihui.name>
Date: Fri, 04 May 2012 12:02:54 -0500

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:

> Hi All,
>
> I was wondering if there would be any interest in adding an option to the
> "save" function in R that I think would be useful. I was thinking that it
> might be useful to have an option that would generate a ".sessionInfo"
> variable that contains the output of "sessionInfo()", and adds it to the
> list of objects to be saved. This way, whenever an RData object is loaded,
> all the information about the R version, and attached packages present
> would be available for query.
>
> I know I have been bitten by the problem of generating results using
> different versions of packages and different versions of R. I know that
> this is partly the idea behind Sweave (and other report generation
> measures), and perhaps I am at fault for not keeping better track of these
> types of things, but this seems like it would be useful to a lot of other
> people besides just me.
>
> Thoughts?
>
> -Robert
>
> Robert M. Flight, Ph.D.
> University of Louisville Bioinformatics Laboratory
> University of Louisville
> Louisville, KY
>
> PH 502-852-1809 (HSC)
> PH 502-852-0467 (Belknap)
> EM robert.flight_at_louisville.edu
> EM rflight79_at_gmail.com
> robertmflight.blogspot.com
> bioinformatics.louisville.edu/lab
> github.com/rmflight/general/wiki
>
> The most exciting phrase to hear in science, the one that heralds new
> discoveries, is not "Eureka!" (I found it!) but "That's funny ..." - Isaac
> Asimov
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-devel_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
______________________________________________ R-devel_at_r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Fri 04 May 2012 - 17:10:32 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 04 May 2012 - 17:50:53 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive