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

(새 문서: ==개요== ;R dist() * "Distance Matrix Computation" <source lang='r'> x <- matrix(rnorm(20), nrow=4) x ## [,1] [,2] [,3] [,4] [,5] ## [1,] 1.370...)
 
잔글 (봇: 자동으로 텍스트 교체 (-</source> +</syntaxhighlight>, -<source +<syntaxhighlight ))
 
(다른 사용자 한 명의 중간 판 7개는 보이지 않습니다)
1번째 줄: 1번째 줄:
==개요==
==개요==
;R dist()
;R dist()
* "Distance Matrix Computation"
* "Distance Matrix Computation {{해석|거리 행렬 계산}}"


<source lang='r'>
<syntaxhighlight lang='r' notebook>
x <- matrix(rnorm(20), nrow=4)
x <- matrix(rnorm(20), nrow=4)
x
x
##            [,1]        [,2]      [,3]      [,4]      [,5]
</syntaxhighlight>
## [1,]  1.3709584  0.40426832  2.0184237 -1.3888607 -0.2842529
<syntaxhighlight lang='r' notebook>
## [2,] -0.5646982 -0.10612452 -0.0627141 -0.2787888 -2.6564554
## [3,]  0.3631284  1.51152200  1.3048697 -0.1333213 -2.4404669
## [4,]  0.6328626 -0.09465904  2.2866454  0.6359504  1.3201133
dist(x)
dist(x)
##          1        2        3
</syntaxhighlight>
## 2 3.898462                 
<syntaxhighlight lang='r' notebook>
## 3 2.996086 2.327174       
## 4 2.745816 4.858356 4.283713
dist(x, diag = TRUE)
dist(x, diag = TRUE)
##          1        2        3        4
</syntaxhighlight>
## 1 0.000000                         
<syntaxhighlight lang='r' notebook>
## 2 3.898462 0.000000                 
## 3 2.996086 2.327174 0.000000       
## 4 2.745816 4.858356 4.283713 0.000000
dist(x, upper = TRUE)
dist(x, upper = TRUE)
##          1        2        3        4
</syntaxhighlight>
## 1          3.898462 2.996086 2.745816
## 2 3.898462          2.327174 4.858356
## 3 2.996086 2.327174          4.283713
## 4 2.745816 4.858356 4.283713       
</source>


==같이 보기==
==같이 보기==
* [[R daisy()]]
* [[R daisy()]]
* [[R hclust()]]
* [[R hclust()]]
* [[R fanny()]]
* [[거리 행렬]]


==참고==
==참고==

2021년 4월 28일 (수) 22:30 기준 최신판

1 개요[ | ]

R dist()
  • "Distance Matrix Computation → 거리 행렬 계산"
x <- matrix(rnorm(20), nrow=4)
x
dist(x)
dist(x, diag = TRUE)
dist(x, upper = TRUE)

2 같이 보기[ | ]

3 참고[ | ]

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