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

 
(같은 사용자의 중간 판 하나는 보이지 않습니다)
3번째 줄: 3번째 줄:
* "Levels Attributes"
* "Levels Attributes"


<source lang='r'>
<source lang='r' run>
x <- factor(c(1,1,1,1,2,2,2,2))
x <- factor(c(1,1,1,1,2,2,2,2))
options(echo=T)
x
x
## [1] 1 1 1 1 2 2 2 2
## Levels: 1 2
levels(x)[1] <- "low"
levels(x)[1] <- "low"
levels(x)[2] <- "high"
levels(x)[2] <- "high"
x
x
## [1] low  low  low  low  high high high high
## Levels: low high
</source>
</source>


==같이 보기==
==같이 보기==
* [[R gl()]]
* [[R gl()]]
* [[R factor()]]
* [[R nlevels()]]
* [[R nlevels()]]
* [[R relevel()]]
* [[R relevel()]]

2020년 2월 3일 (월) 19:29 기준 최신판

1 개요[ | ]

R levels()
  • "Levels Attributes"
x <- factor(c(1,1,1,1,2,2,2,2))
options(echo=T)
x
levels(x)[1] <- "low"
levels(x)[2] <- "high"
x

2 같이 보기[ | ]

3 참고[ | ]

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