user438602
user438602

Reputation:

R: how to compute the distance between the columns of a matrix?

The R function dist "computes and returns the distance matrix computed by using the specified distance measure to compute the distances between the rows of a data matrix".

However, I want the distance measure to be computed between the columns of a data matrix, not the rows! How can I do that?

Do I need to rotate the matrix. If so, how? If not, should I use a different function?

Upvotes: 3

Views: 5362

Answers (1)

folex
folex

Reputation: 5297

Maybe you can use R function t? t(x) will transpose matrix x.

Upvotes: 7

Related Questions