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

 
(사용자 2명의 중간 판 3개는 보이지 않습니다)
4번째 줄: 4번째 줄:
* 객체의 차원을 조회하거나 설정하는 R 함수
* 객체의 차원을 조회하거나 설정하는 R 함수


<source lang='r' run>
<syntaxhighlight lang='r' notebook>
options(echo = TRUE)
1:6
1:6
</syntaxhighlight>
<syntaxhighlight lang='r' notebook>
class( 1:6 )
class( 1:6 )
</syntaxhighlight>
<syntaxhighlight lang='r' notebook>
dim( 1:6 )
dim( 1:6 )
</source>
</syntaxhighlight>
<source lang='r' run>
<syntaxhighlight lang='r' notebook=2>
options(echo = TRUE)
diag(2)
diag(2)
</syntaxhighlight>
<syntaxhighlight lang='r' notebook=2>
class( diag(2) )
class( diag(2) )
</syntaxhighlight>
<syntaxhighlight lang='r' notebook=2>
dim( diag(2) )
dim( diag(2) )
</source>
</syntaxhighlight>
<source lang='r' run>
<syntaxhighlight lang='r' notebook=3>
options(echo = TRUE)
matrix(1:6, 2, 3)
matrix(1:6, 2, 3)
</syntaxhighlight>
<syntaxhighlight lang='r' notebook=3>
class( matrix(1:6, 2, 3) )
class( matrix(1:6, 2, 3) )
</syntaxhighlight>
<syntaxhighlight lang='r' notebook=3>
dim( matrix(1:6, 2, 3) )
dim( matrix(1:6, 2, 3) )
</source>
</syntaxhighlight>
<source lang='r' run>
<syntaxhighlight lang='r' notebook=3>
options(echo = TRUE)
m <- matrix(1:6, 2, 3)
m <- matrix(1:6, 2, 3)
m
m
</syntaxhighlight>
<syntaxhighlight lang='r' notebook=3>
dim( m ) <- c(3:2)
dim( m ) <- c(3:2)
m
m
</source>
</syntaxhighlight>
<source lang='r' run>
<syntaxhighlight lang='r' notebook=4>
options(echo = TRUE)
BOD
BOD
</syntaxhighlight>
<syntaxhighlight lang='r' notebook=4>
dim(BOD)
dim(BOD)
</source>
</syntaxhighlight>


==같이 보기==
==같이 보기==
43번째 줄: 54번째 줄:
* [[R nrow()]]
* [[R nrow()]]
* [[R dimnames()]]
* [[R dimnames()]]
* [[R 행수 확인]]
* [[R 컬럼수 확인]]
* [[R 행수, 컬럼수 확인]]
* [[NumPy shape]]
* [[NumPy shape]]
* [[Pandas shape]]
}}
}}



2021년 10월 3일 (일) 02:34 기준 최신판

1 개요[ | ]

R dim()
  • "dimension"
  • 객체의 차원을 조회하거나 설정하는 R 함수
1:6
class( 1:6 )
dim( 1:6 )
diag(2)
class( diag(2) )
dim( diag(2) )
matrix(1:6, 2, 3)
class( matrix(1:6, 2, 3) )
dim( matrix(1:6, 2, 3) )
m <- matrix(1:6, 2, 3)
m
dim( m ) <- c(3:2)
m
BOD
dim(BOD)

2 같이 보기[ | ]

3 참고[ | ]

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