Re: [R] does column exist?

2005-05-19 Thread Prof Brian Ripley
On Thu, 19 May 2005 [EMAIL PROTECTED] wrote: There may be a simpler way, but this is.na(match("X", names(df))) should return TRUE if the column name exists and FALSE otherwise. Mere syntactic sugar, but "X" %in% names(mydf) is self-documenting. How do I test if a data.frame has a column named X? ex

Re: [R] does column exist?

2005-05-19 Thread Spencer Graves
Subject [R] does column exist?

Re: [R] does column exist?

2005-05-19 Thread apjaworski
at.math.ethz.ch Subject [R] does column exist? 05/19/2005 12:42

Re: [R] does column exist?

2005-05-19 Thread Chuck Cleland
How about is.null(df$X)==FALSE ? Omar Lakkis wrote: 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) __ R-help@

[R] does column exist?

2005-05-19 Thread 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) __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch