Different behaviors between data frame and matrix in…

Different behaviors between data frame and matrix in R