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

(새 문서: ==개요== ;R substr() <source lang='r'> substr("ABCDEF", 3, 3) ## [1] "C" substr("ABCDEF", 3, 5) ## [1] "CDE" </source> <source lang='r'> substr(c("ABCDEFGH","abcdefgh","12345678","...)
 
27번째 줄: 27번째 줄:
* [[R nchar()]]
* [[R nchar()]]
* [[R strsplit()]]
* [[R strsplit()]]
* [[함수 substr()]]


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

2019년 4월 19일 (금) 16:59 판

1 개요

R substr()
substr("ABCDEF", 3, 3)
## [1] "C"
substr("ABCDEF", 3, 5)
## [1] "CDE"
substr(c("ABCDEFGH","abcdefgh","12345678","QWERTYUI"), 1, 1)
## [1] "A" "a" "1" "Q"
substr(c("ABCDEFGH","abcdefgh","12345678","QWERTYUI"), 1, 3)
## [1] "ABC" "abc" "123" "QWE"
substr(c("ABCDEFGH","abcdefgh","12345678","QWERTYUI"), 1, 2:3)
## [1] "AB"  "abc" "12"  "QWE"
substr(c("ABCDEFGH","abcdefgh","12345678","QWERTYUI"), 1:2, 4)
## [1] "ABCD" "bcd"  "1234" "WER" 
substr(c("ABCDEFGH","abcdefgh","12345678","QWERTYUI"), 1:4, 4)
## [1] "ABCD" "bcd"  "34"   "R"   
substr(c("ABCDEFGH","abcdefgh","12345678","QWERTYUI"), 1:4, 4:7)
## [1] "ABCD" "bcde" "3456" "RTYU"

2 같이 보기

3 참고

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