search for: textractedvector

Displaying 1 result from an estimated 1 matches for "textractedvector".

Did you mean: extractedvector
2006 Jul 27
2
Vector extracted from a matrix. How can I specify dimensions in as.matrix?
...ted from a matrix, its dimension is NULL. In this case the transposed dimension is correct, but you'll see the next example, that if a row was extracted, the dimension would be wrong: initialmatrix <- matrix(1:9,3,3) extractedvector <-initialmatrix[,1] # extract first columm as vector textractedvector <-t(extractedvector)#transposed dim(extractedvector) #NULL!!!! <- not working dim(textractedvector)#1x3 as expected I have tried to transform the extracted vector as.vector and as.matrix. as.vector does not give the what I want (still NULL) and as.matrix can't specify the number of row...