R setNames()

Jmnote (토론 | 기여)님의 2020년 10월 25일 (일) 18:15 판 (새 문서: ==개요== ;R setNames() * "Set the Names in an Object {{해석|객체 내에 이름 설정}}" <syntaxhighlight lang='r' run> setNames( 1:3, c("foo", "bar", "baz") ) # this is just a...)
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)

1 개요

R setNames()
  • "Set the Names in an Object → 객체 내에 이름 설정"
setNames( 1:3, c("foo", "bar", "baz") )
# this is just a short form of
tmp <- 1:3
names(tmp) <-  c("foo", "bar", "baz")
tmp

## special case of character vector, using default
setNames(nm = c("First", "2nd"))

2 같이 보기

3 참고

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