matrix icon indicating copy to clipboard operation
matrix copied to clipboard

Row and Column Names

Open Planeshifter opened this issue 10 years ago • 1 comments

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

Planeshifter avatar Nov 12 '15 22:11 Planeshifter

I feel like like this strays toward dfs.

kgryte avatar Nov 12 '15 22:11 kgryte