These methods merge two or more objects of class types
.
Value
An object of the class types
.
Examples
(tps1 <- as_types(c("a", "simple", "simple", "example")))
#> Type collection of length 3
#> type
#> -------
#> 1 a
#> 2 example
#> 3 simple
(tps2 <- as_types(c("with", "a", "few", "words")))
#> Type collection of length 4
#> type
#> -----
#> 1 a
#> 2 few
#> 3 with
#> 4 words
(tps3 <- as_types(c("just", "for", "testing")))
#> Type collection of length 3
#> type
#> -------
#> 1 for
#> 2 just
#> 3 testing
types_merge(tps1, tps2) # always removes duplicates, but doesn't sort
#> Type collection of length 6
#> type
#> -------
#> 1 a
#> 2 example
#> 3 simple
#> 4 few
#> 5 with
#> 6 words
sort(types_merge(tps1, tps2)) # same, but with sorting
#> Type collection of length 6
#> type
#> -------
#> 1 a
#> 2 example
#> 3 few
#> 4 simple
#> 5 with
#> 6 words
types_merge_all(tps1, tps2, tps3)
#> Type collection of length 9
#> type
#> -------
#> 1 a
#> 2 example
#> 3 simple
#> 4 few
#> 5 with
#> 6 words
#> 7 for
#> 8 just
#> 9 testing
types_merge_all(list(tps1, tps2, tps3))
#> Type collection of length 9
#> type
#> -------
#> 1 a
#> 2 example
#> 3 simple
#> 4 few
#> 5 with
#> 6 words
#> 7 for
#> 8 just
#> 9 testing