Re: [Rd] Show location of workspace image on quit?

From: Barry Rowlingson <b.rowlingson_at_lancaster.ac.uk>
Date: Fri, 05 Jun 2009 21:52:13 +0100

Here's a replacement 'q' function that spits out the path of the workspace image:

q = function (save = "default", status = 0, runLast = TRUE) {
cat(paste("Workspace image is
",file.path(getwd(),formals(save.image)$file),'\n')) flush.console()
.Internal(quit(save, status, runLast))
}

Note the trickiness for getting the file name - without diving into internals I can't see how q() gets the filename so I'm just robbing the default value from save.image. The flush.console makes sure the path is printed before Windows shows the confirmation dialog. Yes it would be nicer if the path was included on the dialog, but that's about 100 times as much work as adding two lines to the existing q definition.

Anyway, that does the job for me.

Barry



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Fri 05 Jun 2009 - 21:57:17 GMT

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 05 Jun 2009 - 22:35:52 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