What is rbind in R?

This recipe explains what is rbind in R

Recipe Objective

Binding or combining rows or columns of two different dataframes is an important task to perform in data manipulation. we use rbind() and cbind() function to carry out this task on rows and columns respectively.

This recipe demonstrates the use of rbind() function.

rbind() function combines the rows of two dataframes of equal length.

Explore the Real-World Applications of Recommender Systems

Step 1: Creating two Dataframes

We use data.frame() function to create DataFrames

Name = c("Ram", "Fredo", "Geeta", "Jessica") rank = c(3,4,1,2) marks = c(50, 45, 95, 80) ​ dataframe1 = data.frame(Name,rank,marks) dataframe1

A data.frame: 4 x 3
Ram	3	50
Fredo	4	45
Geeta	1	95
Jessica	2	80

Name = c("Suresh", "Ramesh") rank = c(6,5) marks = c(40,43) dataframe2 = data.frame(Name,rank,marks) dataframe2

A data.frame: 2 x 3
Suresh	6	40
Ramesh	5	43

Step 2: Using rbind() to combine dataframes 1 and 2

Syntax: rbind(dataframe1,dataframe2)

# combining the rows of the two dataframes dataframe3 = rbind(dataframe1,dataframe2) dataframe3

A data.frame: 6 x 3
Ram	3	50
Fredo	4	45
Geeta	1	95
Jessica	2	80
Suresh	6	40
Ramesh	5	43

What Users are saying..

profile image

Ameeruddin Mohammed

ETL (Abintio) developer at IBM
linkedin profile url

I come from a background in Marketing and Analytics and when I developed an interest in Machine Learning algorithms, I did multiple in-class courses from reputed institutions though I got good... Read More

Relevant Projects

House Price Prediction Project using Machine Learning in Python
Use the Zillow Zestimate Dataset to build a machine learning model for house price prediction.

AWS Project to Build and Deploy LSTM Model with Sagemaker
In this AWS Sagemaker Project, you will learn to build a LSTM model on Sagemaker for sales forecasting while analyzing the impact of weather conditions on Sales.

MLOps AWS Project on Topic Modeling using Gunicorn Flask
In this project we will see the end-to-end machine learning development process to design, build and manage reproducible, testable, and evolvable machine learning models by using AWS

Learn Hyperparameter Tuning for Neural Networks with PyTorch
In this Deep Learning Project, you will learn how to optimally tune the hyperparameters (learning rate, epochs, dropout, early stopping) of a neural network model in PyTorch to improve model performance.

Time Series Forecasting with LSTM Neural Network Python
Deep Learning Project- Learn to apply deep learning paradigm to forecast univariate time series data.

Recommender System Machine Learning Project for Beginners-3
Content Based Recommender System Project - Building a Content-Based Product Recommender App with Streamlit

Credit Card Fraud Detection as a Classification Problem
In this data science project, we will predict the credit card fraud in the transactional dataset using some of the predictive models.

Recommender System Machine Learning Project for Beginners-1
Recommender System Machine Learning Project for Beginners - Learn how to design, implement and train a rule-based recommender system in Python

Deep Learning Project for Time Series Forecasting in Python
Deep Learning for Time Series Forecasting in Python -A Hands-On Approach to Build Deep Learning Models (MLP, CNN, LSTM, and a Hybrid Model CNN-LSTM) on Time Series Data.

Hands-On Approach to Regression Discontinuity Design Python
In this machine learning project, you will learn to implement Regression Discontinuity Design Example in Python to determine the effect of age on Mortality Rate in Python.