rbind() function in R Language is used to combine specified Vector, Matrix or Data Frame by rows.
Syntax: rbind(x1, x2, …, deparse.level = 1)
Parameters:
x1, x2: vector, matrix, data frames
deparse.level: This value determines how the column names generated. The default value of deparse.level is 1.
Example 1:
# R program to illustrate # rbind function # Initializing two vectors x <- 2:7y <- c(2, 5) # Calling rbind() function rbind(x, y) |
chevron_right
filter_none
Output:
[, 1] [, 2] [, 3] [, 4] [, 5] [, 6] x 2 3 4 5 6 7 y 2 5 2 5 2 5
Example 2:
# R program to illustrate # rbind function # Initializing a vector x <- 1:5 # Calling rbind() function rbind(x, 4) rbind(x, 5, deparse.level = 0) rbind(x, 6, deparse.level = 2) rbind(x, 4, deparse.level = 6) |
chevron_right
filter_none
Output:
[, 1] [, 2] [, 3] [, 4] [, 5]
x 1 2 3 4 5
4 4 4 4 4
[, 1] [, 2] [, 3] [, 4] [, 5]
[1, ] 1 2 3 4 5
[2, ] 5 5 5 5 5
[, 1] [, 2] [, 3] [, 4] [, 5]
x 1 2 3 4 5
6 6 6 6 6 6
[, 1] [, 2] [, 3] [, 4] [, 5]
[1, ] 1 2 3 4 5
[2, ] 4 4 4 4 4
Recommended Posts:
- Combine Vectors, Matrix or Data Frames by Columns in R Language - cbind() Function
- Comparing values of data frames in R Programming - all_equal() Function
- Merge Two Data Frames by common Columns in R Programming - merge() Function
- Get the natural logarithm of the beta value of Non-Negative numeric vectors in R Language - lbeta() Function
- R - Data Frames
- Manipulate R Data Frames Using SQL
- Create a Data Frame of all the Combinations of Vectors passed as Argument in R Programming - expand.grid() Function
- Combine Arguments into a Vector in R Programming - c() Function
- Concatenating Objects in R Programming - combine() Function
- Creating a Data Frame from Vectors in R Programming
- Create Matrix from Vectors in R
- Convert a Data Frame into a Numeric Matrix in R Programming - data.matrix() Function
- Getting and Setting Length of the Vectors in R Programming - length() Function
- Compute the beta value of Non-Negative Numeric Vectors in R Programming - beta() Function
- Compute the Covariance between Two Vectors in R Programming - cov() Function
- Compute the Correlation Coefficient Value between Two Vectors in R Programming - cor() Function
- Generating sequenced Vectors in R Programming - sequence() Function
- Find positions of Matching Elements between Vectors in R Programming - match() Function
- Generate Color Vectors of desired Length in R Programming - rainbow() Function
- Binding rows and columns of a Data Frame in R - bind_rows() and bind_cols() 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 contribute@geeksforgeeks.org. 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.

