A data frame in R is also a two-dimensional arrangement like a matrix, but it can contain a combination of data types in different columns. One column could be numeric, another column could be character. A data frame can be considered as a natural generalization of a matrix in R. In this recipe, you will learn how to create a data frame and how to access various columns and/or elements of it.
Creating a data frame and accessing its properties
Getting ready
Since you have already learned to create a matrix, it will be relatively simple to understand the data frame. It is good to have an understanding of variables and datasets. Though the structure of a data frame is similar to a matrix, it has more information within it.
...