Skip to content

zoo column names

3 messages · Pete B, Achim Zeileis

#
Hi All

I am trying to find a way to prevent column names from changing on zoo
objects when I merge them.

I have column names that contain a "-" that after merging have become "."

# Example
zz1 = zoo(as.matrix(1:5))
zz2 = zoo(as.matrix(10:12))

names(zz1)=c("aa-1")
names(zz2)=c("bb-1")

zz3=merge(zz1,zz2)
print(zz3)

Obviously, I could do something like

names(zz3) = c(names(zz1),names(zz2))

but I have a large number of zoo objects that I am merging. Creating the
simple line above is not that easy.

Any thoughts would be gratefully received.

Kind regards

Pete
#
On Sat, 8 Jan 2011, Pete B wrote:

            
merge(zz1, zz2, check.names = FALSE)

should do what you want.

(This is also the default in the devel version on R-Forge.)

hth,
Z