Abstract
A data frame is the most common way of storing data in R and, generally, is the data structure most often used for data analyses. Under the hood, a data frame is a list of equal-length vectors. Each element of the list can be thought of as a column and the length of each element of the list is the number of rows. As a result, data frames can store different classes of objects in each column (i.e. numeric, character, factor). In essence, the easiest way to think of a data frame is as an Excel worksheet that contains columns of different types of data but are all of equal length rows. In this chapter I will illustrate how to create data frames, add additional elements to pre-existing data frames, add attributes to data frames, and subset data frames.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2016 Springer International Publishing Switzerland
About this chapter
Cite this chapter
Boehmke, B.C. (2016). Managing Data Frames. In: Data Wrangling with R. Use R!. Springer, Cham. https://doi.org/10.1007/978-3-319-45599-0_13
Download citation
DOI: https://doi.org/10.1007/978-3-319-45599-0_13
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-45598-3
Online ISBN: 978-3-319-45599-0
eBook Packages: Mathematics and StatisticsMathematics and Statistics (R0)