"R 벡터 정수 인덱스로 원소 선택"의 두 판 사이의 차이

(새 문서: ==개요== ;Numeric Index Vector ;Using integer vector as index ;R 벡터 정수 인덱스로 원소 선택 <source lang='r'> x <- letters[1:10] x ## [1] "a" "b" "c" "d" "e" "f" "g...)
 
36번째 줄: 36번째 줄:


==참고==
==참고==
* {https://www.datamentor.io/r-programming/vector/
* https://www.datamentor.io/r-programming/vector/
* http://www.r-tutor.com/r-introduction/vector/vector-index
* http://www.r-tutor.com/r-introduction/vector/vector-index
* http://www.r-tutor.com/r-introduction/vector/numeric-index-vector
* http://www.r-tutor.com/r-introduction/vector/numeric-index-vector


[[분류: R 벡터]]
[[분류: R 벡터]]

2019년 4월 15일 (월) 21:44 판

1 개요

Numeric Index Vector
Using integer vector as index
R 벡터 정수 인덱스로 원소 선택
x <- letters[1:10]
x
##  [1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "j"

x[1]
## [1] "a"
x[3]
## [1] "c"

x[3:5]
## [1] "c" "d" "e"
x[c(3,6,7)]
## [1] "c" "f" "g"

x[0]
## character(0)
x[-1]
## [1] "b" "c" "d" "e" "f" "g" "h" "i" "j"
x[-2]
## [1] "a" "c" "d" "e" "f" "g" "h" "i" "j"

x[c(-2:-8)]
## [1] "a" "i" "j"
x[-c(2:8)]
## [1] "a" "i" "j"

2 같이 보기

3 참고

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