作者rockken (態度)
看板Statistics
標題[程式] R lattice
時間Thu Apr 22 15:21:22 2010
[軟體程式類別]:
請填入軟體程式類別 R
[程式問題]:
敘述統計等
[軟體熟悉度]:
請把以下不需要的部份刪除
中(3個月到1年)
[問題敘述]:
請詳盡敘述遭遇到的問題,可能的話,分點敘述你要處理的流程
我資料量很大,我想把資料用 histogram 圖型表示。
資料中有採用月份區別,所以我選擇用 lacttice 中的 histogram 指令。
但我遇到問題,月份區別 levels 會從小排到大,去別出圖形如下。
----------------
| 十月 |十二月 |
| | |
-----------------
| 一月 | 六月 |
| | |
-----------------
但我想要改變它順序 是否有辦法?? 請大大交交我,謝謝。
|----------------
clickhere大大:我還是不懂。
這是我程式碼:
histogram(~ Length|month, data
=sub.Mdata1,xlim=c(30,120),inches=F,scale="free",col=3,type=c("count"),layout
= c(length(year),6), nint =length(seq(40,120)))
是要改 |factor(month) ?? 也不是我要結果。
可以只點一下嗎??
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.117.96.182
→ clickhere:用factor, 改月份的 level 04/22 16:42
※ 編輯: rockken 來自: 140.117.96.182 (04/22 17:37)
→ lin15:應該是 month<-as.factor(month) 04/23 10:50
→ lin15:levels(month)<- c("","".....略) 04/23 10:51
→ rockken:謝謝兩位大大,我今天有找到 上述方法 可是結果一樣 04/23 12:16
→ rockken:不過我解決的 謝謝 我用比較笨方法index.cond 去設位置 04/23 12:16