Question: what is the difference between data frame and a matrix in r?
Answer: All columns in a matrix must have the same data type (numeric, character, etc.) and the same length. A data frame is more general than a matrix, in that different columns can have different modes (numeric, character, factor, etc.). ... A data frame combines features of matrices and lists.