Re: [R] exact matching of names in attr

2007-02-26 Thread Henrik Bengtsson
if (!"name" %in% names(attributes(dat))) { ... } /Henrik On 2/26/07, Michael Toews <[EMAIL PROTECTED]> wrote: > In R 2.5.0 (r40806), one of the change is to allow partial matching of > "name" in the attr function. However, how can I tell if I have an exact > match or not? > > For example, check

[R] exact matching of names in attr

2007-02-26 Thread Michael Toews
In R 2.5.0 (r40806), one of the change is to allow partial matching of "name" in the attr function. However, how can I tell if I have an exact match or not? For example, checking to see if an object has a "name" attribute, then giving it one if it doesn't: dat <- data.frame(x=1:10,y=rnorm(10))