Displaying 1 result from an estimated 1 matches for "cleanupworkspace".
2009 Dec 17
2
issue with using rm: cannot generate on-the-fly list
...e index. The loop
is not contained within a function, so the scope of variables declared in
the loop is global. Within this loop I generate several variables which
should be removed at the end of each iteration. To do this, I wrote a
function to clean up the workspace. An example is included here:
cleanUpWorkspace<-function()
{
#Remove key data sructures, if they have been declared:
delList<-list()
for(varname in c("rv1","rv2", "rv3", "rv4")) {
if(exists(varname)) {
delList<-append(delList, varname)
}
}
if(length...