Re: [R] How to drop variables using a wildcard and logic...

2007-03-26 Thread mtb954
Thanks Phil and Benilton! Mark On 3/26/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Dear R users > > I would like to make a new dataframe from an existing dataframe, > retaining ONLY those variables that end in the letter "t" > > I have searched the help archives and consulted several ref

Re: [R] How to drop variables using a wildcard and logic...

2007-03-26 Thread Sundar Dorai-Raj
Alternatively, you can use ?glob2rx test[, grep(glob2rx("*[tT]"), names(test))] which allows for wildcards. --sundar Benilton Carvalho said the following on 3/26/2007 12:19 PM: > if 'test' is your data frame... > > test[, grep("[tT]$", names(test))] > > b > > On Mar 26, 2007, at 3:06 PM, [EM

Re: [R] How to drop variables using a wildcard and logic...

2007-03-26 Thread Benilton Carvalho
if 'test' is your data frame... test[, grep("[tT]$", names(test))] b On Mar 26, 2007, at 3:06 PM, [EMAIL PROTECTED] wrote: > Dear R users > > I would like to make a new dataframe from an existing dataframe, > retaining > ONLY those variables that end in the letter "t" > > I have searched the

[R] How to drop variables using a wildcard and logic...

2007-03-26 Thread mtb954
Dear R users I would like to make a new dataframe from an existing dataframe, retaining ONLY those variables that end in the letter "t" I have searched the help archives and consulted several reference books but cannot seem to find an example. Any ideas...? Thanks! Mark [[alternative