Use 'drop=FALSE'
> temp2 <- matrix(rnorm(10),nc=1)
> rownames(temp2) <- c("a","b","c","d","e","f","g","h","i",'j')
> print(temp2)
[,1]
a -0.5686687
b -0.1351786
c 1.1780870
d -1.5235668
e 0.5939462
f 0.3329504
g 1.0630998
h -0.3041839
i 0.3700188
j 0.2670988
> temp2 <- temp2[order(te
This is what I get:
> temp2 <- matrix(rnorm(10),nc=1,nrow=5)
> rownames(temp2) <- c("a","b","c","d","e","f","g","h","i")
Error in dimnames(x) <- dn :
length of 'dimnames' [1] not equal to array extent
> R.version.string
[1] "R version 2.8.1 Patched (2008-12-26 r47350)"
On Wed, Feb 11, 2009 at 1
2 matches
Mail list logo