bind: Combine 'Vegsoup*' objects

Description Usage Arguments Details Value Warning Author(s) See Also Examples

Description

Take a sequence of arguments of objects from class Vegsoup* and combine them into a single object.

Usage

1
2
  ## S4 method for signature 'Vegsoup'
bind(..., deparse.level = 1)

Arguments

...

Vegsoup objects.

deparse.level

Not used.

Details

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).

Value

On object of class VegsoupData.

Warning

The method raises an error if plot names are not unique after combining objects.

Author(s)

Roland Kaiser

See Also

Vegsoup

Examples

 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))

vegsoup documentation built on Feb. 24, 2021, 3 a.m.