Re: [R] Removing objects from workspace

2009-08-25 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Ronggui Huang > Sent: Monday, August 24, 2009 9:26 PM > To: Steven Kang > Cc: r-help@r-project.org > Subject: Re: [R] Removing objects from workspace >

Re: [R] Removing objects from workspace

2009-08-24 Thread Ronggui Huang
It depends. If there are patterns in the names, you can make use of pattern argument of ls(). For example, > x1="a";x2="b";x3="c" > ls(pattern="x[1-2]") [1] "x1" "x2" > ls(pattern="x[^1-2]") [1] "x3" # to remove x1-x3 >rm(list=ls(pattern="x[1-2]")) More generally, if you want to remove all butx,x