[R] wildcards and removing variables

2005-10-10 Thread Afshartous, David
All, Is there are a wildcard in R for varible names as in unix? For example, rm(results*) to remove all variable or function names that begin w/ results? cheers, Dave ps - please respond directly to [EMAIL PROTECTED]

Re: [R] wildcards and removing variables

2005-10-10 Thread Marc Schwartz (via MN)
On Mon, 2005-10-10 at 10:37 -0400, Afshartous, David wrote: All, Is there are a wildcard in R for varible names as in unix? For example, rm(results*) to remove all variable or function names that begin w/ results? cheers, Dave ps - please

Re: [R] wildcards and removing variables

2005-10-10 Thread Johan Sandblom
rm() can take a list of object names as an argument and ls(pattern='^results') gives such a list. So rm(ls(pattern='^results')) would remove all objects that are matched by the regular expression, that is all that begin with 'results' HTH, Johan 2005/10/10, Marc Schwartz (via MN) [EMAIL

Re: [R] wildcards and removing variables

2005-10-10 Thread Gabor Grothendieck
On 10/10/05, Marc Schwartz (via MN) [EMAIL PROTECTED] wrote: On Mon, 2005-10-10 at 10:37 -0400, Afshartous, David wrote: All, Is there are a wildcard in R for varible names as in unix? For example, rm(results*) to remove all variable or function names

Re: [R] wildcards and removing variables

2005-10-10 Thread Prof Brian Ripley
On Mon, 10 Oct 2005, Marc Schwartz (via MN) wrote: On Mon, 2005-10-10 at 10:37 -0400, Afshartous, David wrote: All, Is there are a wildcard in R for varible names as in unix? For example, rm(results*) to remove all variable or function names that begin w/ results?

Re: [R] wildcards and removing variables

2005-10-10 Thread Roger D. Peng
In R 2.2.0, there is the function 'glob2rx()' which can be used for this purpose. As in rm(list = ls(pattern = glob2rx(results*))) -roger Afshartous, David wrote: All, Is there are a wildcard in R for varible names as in unix? For example, rm(results*) to

Re: [R] wildcards and removing variables

2005-10-10 Thread Marc Schwartz (via MN)
On Mon, 2005-10-10 at 16:01 +0100, Prof Brian Ripley wrote: On Mon, 10 Oct 2005, Marc Schwartz (via MN) wrote: On Mon, 2005-10-10 at 10:37 -0400, Afshartous, David wrote: All, Is there are a wildcard in R for varible names as in unix? For example, rm(results*) to