Concatenating Objects in R Programming – combine() Function
In R programming, coercion function c() and combine() function are similar to each other but are different in a way. combine() functions acts like c() and unlist() functions but uses consistent dplyr coercion rules. Moreover, combine() function is used to combine factors in R programming. In this article, we’ll see the implementation of combine() and c() function with same outputs and different outputs on the same operation.
Syntax: combine(x, y, …)
x, y, …. are vectors to combine
In this example, we’ll see the same output of both these functions on same operation.
Using c() function:  1 2 3 4 5 6 Using combine() function:  1 2 3 4 5 6
In this example, we’ll see the different outputs of both these functions on the same operation.
Using c() function:  1 1 2 3 2 1 3 2 Using combine() function:  a a b c b a c b Levels: a b c