O'Reilly logo

Using R for Statistics by Sarah Stowell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 4

image

Combining and Restructuring Datasets

This chapter explains how to make major changes to the structure of a dataset. You may need to combine data from two or more different sources into one dataset. This may be as simple as attaching one dataset to the bottom or side of another (known as appending or concatenating), or it may involving using a common variable to match the observations (known as merging). Alternatively, you may need to combine the values from several variables into one variable (stacking) or split one variable into several variables (unstacking). Finally, you may need to reshape a dataset so that data that was once held ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required