Objectives


Related to: Data Computing p. 29

<– Back to Table of Contents

Data structures: The “building blocks” of R

Data frames

Data frames are one of R’s most useful structures for organizing and manipulating data. They are the basic organizational structure you’ll use for most data analyses. In fact, you’ve already encountered data frames: whenever you use the function read.csv(), R automatically converts your data to a data frame behind the scenes and stores it into your R environment for you to work with.

You can think of data frames as similar to a spreadsheet in Excel. Data frames contain rows representing specific cases or observations in the dataset. Data frames also contain columns representing measurements for each observation along different variables.