Re: [R] issue with using rm: cannot generate on-the-fly list

2009-12-17 Thread Duncan Murdoch
On 17/12/2009 5:33 AM, Cormac Long wrote: Hello, I have the following problem when trying to use rm: In a top level script file I have a loop iterating over some index. The loop is not contained within a function, so the scope of variables declared in the loop is global. Within this loop I gene

Re: [R] issue with using rm: cannot generate on-the-fly list

2009-12-17 Thread Romain Francois
The list argument of rm is supposed to be a character vector, as indicated in ?rm. not a list. You can do something like this: rm( list = Filter( exists, c("rv1","rv2", "rv3", "rv4") ) ) or, considering rm only warns when you attempt to remove objects, you could: suppressWarnings( rm( list