Chetan Arvind Patil
Chetan Arvind Patil

Reputation: 866

Why Can't I Access Column Name After Cbind() In R

I have combined different matrix with same row size using cbind(). I observe that the column name of resulting matrix is not accessible using $.

Is there any specific reason for this? Thanks.

Upvotes: 0

Views: 948

Answers (1)

Luís Telles
Luís Telles

Reputation: 694

The $ operator does not work for matrices. Instead use matrix_name[,'column_name'] or matrix_name[,i], being i the column index.

Upvotes: 2

Related Questions