rbind() is base R’s row-binding function: it joins two or more vectors, matrices, or data sets by rows into one object. Use it when observations belong underneath one another, rather than when variables need to be matched side by side. section 4.7 section 14.7
For data sets, compatible structure matters. Two data sets can be stacked when they have the same width and variable names; differing structures produce an error. Column order does not have to match. After binding, check dim() to confirm that row counts were added while the column count stayed unchanged. section 6.3.2 section 14.2.4
Combine NBA seasons into one analysis table
Each season contributes 30 team records with 27 variables. Row-binding 10 season-level data sets produces 300 records while retaining 27 columns. A season variable can then identify where each block of rows came from. section 14.2.4
nbadf1 <- rbind(nba1819, nba1920) dim(nbadf1) ## [1] 4146 57
This compact call stacks two season-level game data sets, then uses dim() to verify the combined 4,146-row, 57-variable result. section 6.3.2
Row-binding also supports analysis preparation beyond season files. It can consolidate separately prepared team records before computing z-scores or K-means inputs, combine regular-season and playoff measurements before a paired plot, or assemble binary position vectors into a constraint matrix. section 4.7 section 11.4.1 section 11.5.1 section 14.7
