Skip to content
Prev 247473 / 398503 Next

a remove question

On Jan 16, 2011, at 4:08 PM, Erin Hodgess wrote:

            
Perhaps:

rm(list= ls()[grep("NY", ls()] )

If there is a pattern argument to rm (I haven't looked)  then it's  
possible that it would have succeeded with pattern="NY",  assuming you  
want any object name with "NY" someplace in it. The "*" looks wrong  
for grepping. ".+" would have looked more greppish, but its not really  
needed.
David Winsemius, MD
West Hartford, CT