Skip to content

How use a matrix method?

3 messages · Grześ, Peter Dalgaard

#
Why when I want to find my value from matrix I get: 2,3,4,1,2? I think that I
should get: 1,2,3,4,7,8.
[1] 2
[1] 3
[1] 4
[1] 1
[1] 2


This is a similar situation:
[1] 9
[1] 9
[1] 9

Why not: 9,8,7
#
Grze? wrote:
That's

matrix(data=1:4, nrow=7, ncol=8)

a 7x8 matrix with the numbers 1 to 4 repeated columnwise.

You probably want something like matrix(c(1:4, 7, 8))
#
Peter Dalgaard wrote: