[R] deleting variables

From: Ralf Goertz <R_Goertz_at_web.de>
Date: Tue, 29 Apr 2008 17:11:08 +0200


How can I automatically exclude one variable from being saved in the workspace when I quit an R session? The problem is I don't know how to erase a variable once it has been created.

Background: I open a connection called "con" to a database server in my ~/.Rprofile. Obviously, the connection expires when quitting the R session. Unfortunately, the workspace is loaded after ~/.Rprofile is run. So "con" get overwritten by the old workspace. I thought of using .First() or .Last() but as these are functions I don't know how to modify global variables.

Ralf



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Tue 29 Apr 2008 - 16:57:45 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 Tue 29 Apr 2008 - 17:30:34 GMT.

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

list of date sections of archive