Skip to content
Prev 323332 / 398500 Next

attr vs attributes

Do you have an example of this?  In R-2.15.3 I don't see that problem:
   > my_obj <- 37:41
   > my_attr_name <- "myAttr"
   > my_attr_value <- as.roman(2012:2013)
   > attributes(my_obj)[[my_attr_name]] <- my_attr_value
   > my_obj
   [1] 37 38 39 40 41
   attr(,"myAttr")
   [1] MMXII  MMXIII

  > attributes(my_obj)[["anotherAttrName"]] <- "another attribute value"
  > my_obj
  [1] 37 38 39 40 41
  attr(,"myAttr")
  [1] MMXII  MMXIII
  attr(,"anotherAttrName")
  [1] "another attribute value"

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com