matrix
matrix copied to clipboard
Row and Column Names
What are your thoughts on allowing for row and column names? R has this feature, and for standard applications in statistics, where the columns of a design matrix hold data for different predictors, this helps immensely. It allows oneself to index via the column and row names, for example. Could we support something similar?
Here is an example:
mat = matrix( c( 40, 29, 55, 5000, 3900, 5500 ), nrow = 3, ncol = 2 )
colnames( mat ) = c( "Age", "Income" )
Printing the matrix then gives the following:
Age Income
[1,] 40 5000
[2,] 29 3900
[3,] 55 5500
I feel like like this strays toward dfs.