0Pricing
R Academy · Lesson

Combining and Reshaping Data

Explore merging, appending, and reshaping data sets for flexible analysis.

1

Introduction to Combining and Reshaping Data

Data often comes from multiple sources and needs to be merged or reshaped for analysis. In this lesson, you will learn how to combine and restructure data in R.

Combining and Reshaping Data — illustration 1

2

Combining Data Frames

You can combine data frames using functions like rbind() (row-wise) and cbind() (column-wise).

df1 <- data.frame(ID = c(1, 2), Score = c(90, 85))
df2 <- data.frame(ID = c(3, 4), Score = c(78, 92))
df_combined <- rbind(df1, df2)

All lessons in this course

  1. Importing Data
  2. Data Cleaning Basics
  3. Combining and Reshaping Data
← Back to R Academy