R introduce manual select from about Matrix

image

image

These two examples mentioned are not well understood. Examples of the corresponding operation

image

image

SEQ [extracting the number of rows, the number of lines extracted several elements, from which extraction matrix], it represents all of the default

E.g

seq[2,3,1]

From the first matrix, the second element of the third row of extraction result 8

Wherein each parameter allows the number of columns in the form of e.g.

> seq[1:2,1,1]
[1] 1 2

Representative, a first matrix (a matrix with the same number of columns, so column matrix should be) the first row element 1-2

> seq[1:2,1,1:2]
      [,1] [,2]
[1,]    1   13
[2,]    2   14

Guess you like

Origin www.cnblogs.com/yuvejxke/p/11989334.html