R relevel()

1 개요[ | ]

R relevel()
  • "Reorder Levels Of Factor"
options(echo=T)
warpbreaks$tension
relevel(warpbreaks$tension, ref = "M")
df <- read.csv(header=T, stringsAsFactors=T, text="
General,Intell,Power,Chrisma
Liu Bei,High,Low,High
Guan Yu,High,High,High
Zhang Fei,Low,High,Low
Sun Gan,Middle,Low,Low
")
options(echo=T)
df
str(df$Intell)
df$Intell <- relevel(df$Intell, ref="Low")
str(df$Intell)

2 같이 보기[ | ]

3 참고[ | ]

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