From the course: SAS Programming for R Users, Part 1

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Concatenating data sets

Concatenating data sets

- [Narrator] Now that we know how to subset data, what if we want to go ahead and column bind or row bind our data back together again? To reproduce the rbind function in r, we'll use a data step. And in the set statement, we'll specify all the data sets we want to row bind. So imagine I have two data sets here, Employees Denmark and Employees France, and I just want to stack them on top of each other and create a new data set called Employees All. Well, I'll just pass the Employees Denmark data table and the Employees France data table to a single set statement and it'll simply stack them on top of each other. The important thing to remember here is, they have to have the exact same column names, otherwise you'll get a block diagonal data table for Employees All. On the other hand, if I have two separate data sets names and home, and I want to column bind them together, I'll use multiple set statements, or you can think of it as creating a column of set statements. And each set…

Contents