Description Usage Arguments Details Value Warning Author(s) See Also Examples
Take a sequence of arguments of objects from class Vegsoup*
and combine them into a single object.
1 2 |
... |
|
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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | 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))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.