Skip to content
Prev 143123 / 398498 Next

deleting variables

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