Re: [R] add names to data frame

2011-04-14 Thread Henrique Dallazuanna
The matrix is generated by print.dist function ( getS3method("print", "dist") ). You could try this: d <- as.matrix(dist(matrix(rnorm(27), 9), diag = TRUE, upper = TRUE)) colnames(d) <- letters[1:9] On Wed, Apr 13, 2011 at 1:29 PM, Radhouane Aniba wrote: > Hi, > > I have a vector V of values

[R] add names to data frame

2011-04-13 Thread Radhouane Aniba
Hi, I have a vector V of values I used to create a distance matrix using dist() function with diag=TRUE and upper=TRUE parameters. I would like to assign names in another vector on top of each column instead of 1 2 3 4 ... How can we do that ? is the distance matrix generated a data frame or a m