Re: [R] does column exist?

From: <>
Date: Fri 20 May 2005 - 03:53:24 EST

There may be a simpler way, but this"X", names(df)))

should return TRUE if the column name exists and FALSE otherwise.



Andy Jaworski
Process Laboratory
3M Corporate Research Laboratory

Tel: (651) 733-6092
Fax: (651) 736-3122
             Omar Lakkis                                                   

m> To Sent by: r-help-bounces@st cc Subject [R] does column exist? 05/19/2005 12:42 PM Please respond to Omar Lakkis

How do I test if a data.frame has a column named X? exists(o) checks if the object exists or not, I want to test if a data.frame object (df) has a column names(X), something like: exists(df$X) mailing list PLEASE do read the posting guide! mailing list PLEASE do read the posting guide! Received on Fri May 20 04:04:07 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:55 EST