Learn R Programming

zoocat (version 0.2.0.1)

merge: Combine zoocat or zoomly Objects by Columns

Description

Combine "zoocat" or "zoomly" objects by columns.

Usage

# S3 method for zoocat
merge(..., all = TRUE, fill = NA, suffixes = NULL,
  check.names = FALSE, retclass = "zoocat", drop = TRUE)

cbind.zoocat(...)

Arguments

...

zoocat or zoomly objects.

all, fill, suffixes, check.names, retclass, drop

See details.

Value

merge.zoocat will return a "zoocat" object. merge.zoomly will return a "zoomly" object.

Details

merge.zoocat and merge.zoomly are the extensions of merge.zoo. For merge.zoocat, when combining cattr, some NA will be filled in if it is necessary. The arguments all and fill are used same as in merge.zoo. The arguments suffixes, check.names, retclass and drop are not used.

Examples

Run this code
# NOT RUN {
x1 <- matrix(1 : 20, nrow = 5)
colAttr <- data.frame(month = c(2, 3, 5, 6), name = 'xxx')
zc1 <- zoocat(x1, order.by = 1991 : 1995, colattr = colAttr)
x2 <- x1 + 100
colAttr2 <- data.frame(modified = TRUE, month = c(4, 6, 7, 9))
zc2 <- zoocat(x2, order.by = 1991 : 1995, colattr = colAttr2)
merge(zc1, zc2)
merge(zc1, lag(zc2), fill = -999)
merge(zc1, lag(zc2), all = FALSE)
cbind(zc1, zc2)

# }

Run the code above in your browser using DataLab