How to add a row to a data frame in R
· 1 min read · Updated March 15, 2026 · beginner
r data-frame dplyr data.table transformation
Adding rows to a data frame is common when building datasets programmatically.
With dplyr
Use bind_rows() to combine data frames by rows:
library(dplyr)
df <- data.frame(name = c("Alice", "Bob"), age = c(25, 30))
new_row <- data.frame(name = "Charlie", age = 28)
df <- bind_rows(df, new_row)
# name age
# 1 Alice 25
# 2 Bob 30
# 3 Charlie 28
With base R
Use rbind() for simple row addition:
df <- rbind(df, data.frame(name = "Diana", age = 35))
With data.table
Efficient for large datasets:
library(data.table)
dt <- data.table(name = c("Alice", "Bob"), age = c(25, 30))
dt <- rbind(dt, list(name = "Charlie", age = 28))
Performance tip
Base R rbind() copies the entire data frame each time. For many additions, collect rows in a list first, then combine once with bind_rows().