[問題] R中如何將Facter Level改名

看板Statistics作者 (是你製造了天氣)時間14年前 (2012/01/10 21:10), 編輯推噓1(102)
留言3則, 2人參與, 最新討論串1/1
跟上個問題一樣的資料,但遇到另一個問題 資料結構: (整筆資料叫Adap) age glucose_consentration .... Result 21 125 1 23 83 0 25 94 0 (以下省略) .... 我想畫boxplot於是用這個函數: boxplot(Glucose ~ Result, data=Adap) 但這樣畫出的兩個圖便會直接以0 和1 當label 我去查boxplot的函式 發現可以用names操控label名稱 請問怎麼做才能幫同時指定兩個label名稱呢? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.112.220.137

01/10 21:30, , 1F
Adap$Result<-factor(Adap$Result, label=c("n1", "n2"))
01/10 21:30, 1F

01/10 21:30, , 2F
然後再用boxplot
01/10 21:30, 2F

01/10 23:54, , 3F
非常感謝:)
01/10 23:54, 3F
文章代碼(AID): #1F33Z4bn (Statistics)