9
I have a set of vectors V_1, V_2, ..., V_n that I would like to convert to a matrix. Each vector becomes a column vector in the matrix. The size of each vector is the same. Is there a simple function to do this? In the matrix section of The R Book it does not appear that this function exists.
What I am currently doing is:
mat=matrix(c(V1, V2, ..., VN), nrow=length(V1))
- Is there some kind of matrix append function to append columns onto the end of a matrix?
EDIT: The end goal is to perform a k-means clustering with this matrix. The names of my vectors are not actually V_1, V_2, ..., V_n. The names of the vectors are substrings corresponding to the file name which the data come from (this is a 1-1 map). Eventually, I will be iterating over all files in a specific directory, extracting the data into a vector and then appending each column vector to a matrix.