bind {vegsoup} | R Documentation |
Vegsoup*
objects Take a sequence of arguments of objects from class Vegsoup*
and combine them into a single object.
## S4 method for signature 'Vegsoup' bind(..., deparse.level = 1)
... |
|
deparse.level |
Not used. |
By calling bind
all slots of the input objects are combined and a new object is returned.
Note, if a list of Vegsoup*
objects needs to be combined, simply call do.call("bind", list.of.Vegsoup.objects)
(see ‘Examples’).
Binding VegsoupPartition objects will inevitably alter the partitioning and the method used to create the objects becomes meaningless.
Note also, that values for slot 'dist' and slot 'decostand' are set to the most frequent values obtained from the input objects (majority rule).
On object of class VegsoupData
.
The method raises an error if plot names are not unique after combining objects.
Roland Kaiser
require(vegsoup) data(barmstein) x <- barmstein # bind Vegsoup objects # first, split object in three parts s1 <- x[1:2, ] s2 <- x[3:4, ] s3 <- x[5:6, ] # combine them xb <- bind(s1, s2, s3) # equivalent ss <- list(s3, s1, s2) xb <- do.call("bind", ss) # note, ordering is changed ( r0 <- rownames(x) ) ( rb <- rownames(xb) ) # restore the orignal order rownames(xb[match(r0, rb), ]) # bind VegsoupPartition objects # first, create 2 partitions (k) k <- 2 i <- sample(k, nrow(x), replace = TRUE) # we might have not obtained what we want due to small size while(length(unique(i)) != k) i <- sample(k, nrow(x), replace = TRUE) p <- VegsoupPartition(x, clustering = i) # subset partitions pp <- sapply(1:k, function (x) partition(p, x)) # bind together again pp <- do.call("bind", pp) identical(partitioning(p), partitioning(pp))