Learn R Programming

mclm (version 0.2.7)

merge_types: Merge 'types' objects

Description

These methods merge two or more objects of class types.

Usage

types_merge(x, y, sort = FALSE)

types_merge_all(..., sort = FALSE)

Value

An object of the class types.

Arguments

x, y

An object of class types.

sort

Logical. Should the results be sorted.

...

Either objects of the class types or lists containing such objects.

Functions

  • types_merge(): Merge two types

  • types_merge_all(): Merge multiple types

Examples

Run this code
(tps1 <- as_types(c("a", "simple", "simple", "example")))
(tps2 <- as_types(c("with", "a", "few", "words")))
(tps3 <- as_types(c("just", "for", "testing")))
types_merge(tps1, tps2)       # always removes duplicates, but doesn't sort
sort(types_merge(tps1, tps2)) # same, but with sorting
types_merge_all(tps1, tps2, tps3)
types_merge_all(list(tps1, tps2, tps3))

Run the code above in your browser using DataLab