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
- Combine Arguments into a Vector in R Programming - c() Function
- Combine Vectors, Matrix or Data Frames by Columns in R Language - cbind() Function
- Combine Vectors, Matrix or Data Frames by Rows in R Language - rbind() Function
- Get Exclusive Elements between Two Objects in R Programming - setdiff() Function
- Intersection of Two Objects in R Programming - intersect() Function
- Check if Two Objects are Equal in R Programming - setequal() Function
- Check for Presence of Common Elements between Objects in R Programming - is.element() Function
- Union of two Objects in R Programming - union() Function
- Get Addition of the Objects passed as Arguments in R Programming - sum() Function
- List all the Objects present in the Current Working Directory in R Programming - ls() Function
- Remove Objects from Memory in R Programming - rm() Function
- Looping over Objects in R Programming
- Getting attributes of Objects in R Language - attributes() and attr() Function
- Getting Multiplication of the Objects passed as Arguments in R Language - prod() Function
- Compare two Objects for Equality in R Progamming - identical() Function
- R - Objects
- R - Creating, Listing, and Deleting Objects in Memory
- Check if a Function is a Primitive Function in R Programming - is.primitive() Function
- Compute Density of the Distribution Function in R Programming - dunif() Function
- Apply a Function over a List of elements in R Programming - lapply() Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : Akanksha_Rai