"R matrix()"의 두 판 사이의 차이

(새 문서: ==개요== ;R matrix() <source lang='r'> A <- matrix( c(1,2,3,4,5,6), nrow=2, ncol=3) class(A) ## [1] "matrix" str(A) ## num [1:2, 1:3] 1 2 3 4 5 6 A ## [,1] [,2] [,3] ## [1,]...)
 
2번째 줄: 2번째 줄:
;R matrix()
;R matrix()


<source lang='r'>
matrix( c(1,2,3,4,5,6), 2, 3)
##      [,1] [,2] [,3]
## [1,]    1    3    5
## [2,]    2    4    6
matrix( c(1,2,3,4,5,6), 3, 2)
##      [,1] [,2]
## [1,]    1    4
## [2,]    2    5
## [3,]    3    6
</source>
<source lang='r'>
<source lang='r'>
A <- matrix( c(1,2,3,4,5,6), nrow=2, ncol=3)
A <- matrix( c(1,2,3,4,5,6), nrow=2, ncol=3)

2019년 4월 19일 (금) 17:15 판

1 개요

R matrix()
matrix( c(1,2,3,4,5,6), 2, 3)
##      [,1] [,2] [,3]
## [1,]    1    3    5
## [2,]    2    4    6
matrix( c(1,2,3,4,5,6), 3, 2)
##      [,1] [,2]
## [1,]    1    4
## [2,]    2    5
## [3,]    3    6
A <- matrix( c(1,2,3,4,5,6), nrow=2, ncol=3)
class(A)
## [1] "matrix"
str(A)
##  num [1:2, 1:3] 1 2 3 4 5 6
A
##      [,1] [,2] [,3]
## [1,]    1    3    5
## [2,]    2    4    6
A <- matrix( c(1,2,3,4,5,6), nrow=2, ncol=3, byrow=TRUE)
class(A)
## [1] "matrix"
str(A)
##  num [1:2, 1:3] 1 4 2 5 3 6
A
##      [,1] [,2] [,3]
## [1,]    1    2    3
## [2,]    4    5    6

2 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}