myDF[! names(myDF) %in% not_wanted]

if I understand you aright.  E.g.

library(MASS)
hills[! names(hills) %in% "climb"]

which can also be done by

subset(hills, select=-climb)

On Mon, 5 Jul 2004, Rado Bonk wrote:

> I'm coming back to R after while. I have a data frame with 200 columns, 
> each column has a name. How to extract all columns to a new dataset, but 
> the specified (by names) ones?

-- 
Brian D. Ripley,                  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to