[R] deleting variables

Ralf Goertz R_Goertz at web.de
Tue Apr 29 17:11:08 CEST 2008


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



More information about the R-help mailing list