Skip to content
Prev 169783 / 398506 Next

Assigning to a vector while keeping the attributes

Try this:

a <- structure(1:3, x = 3)
b <- "attributes<-"(11:15, attributes(a))
dput(b)
On Mon, Feb 9, 2009 at 7:09 AM, Alon Wasserman <alon.was at gmail.com> wrote: