推 celestialgod: 你的seq出來是向量,你想存在一個的位置,當然出錯 12/12 12:09
→ celestialgod: 解決方法是對n迴圈 12/12 12:10
→ celestialgod: for (j in seq_along(n)){ 12/12 12:10
推 celestialgod: final(n[j]) 12/12 12:11
→ celestialgod: } 12/12 12:11
→ celestialgod: l95,r95,l99,r99請放到function內 做return 12/12 12:12
推 celestialgod: 不用做return....多打的...不過你最後兩個mean要記 12/12 12:13
推 celestialgod: 得用c合併再一起return 12/12 12:13
→ ritajen: lt95 rt95 lt99 rt99這個放到function內,那for迴圈還可 12/12 12:20
→ ritajen: 以重複試驗1000次嗎? 還是"多加"在funtion中,然後最後 12/12 12:20
→ ritajen: 兩個mean要合併後return到function嗎? 謝謝 12/12 12:20
→ celestialgod: 有電腦再打詳細程式碼..... 12/12 12:27
→ ritajen: ok 謝謝 12/12 12:32
→ celestialgod: sted 12/12 12:32
→ celestialgod: 沒有排版就抱歉了.... 12/12 12:34
→ ritajen: 點疑問,不曉得原因為何? 12/12 13:22
→ celestialgod: 改好了 在上面的pastebin 12/12 13:39
→ celestialgod: no.two不知道怎麼跑出來的,我明明打no.two的.... 12/12 13:40
推 celestialgod: result[i,]才對,維度未考慮清楚,抱歉 12/12 13:42
→ ritajen: 可以了,謝謝 可以請問一下,所以function自創函數的功 12/12 14:05
→ ritajen: 能,就是可以同時跑出多筆結果嗎? 12/12 14:05
→ celestialgod: 自創函數是幫助你避免一再重複的程式碼,並且增加程 12/12 14:12
→ celestialgod: 式易讀性 12/12 14:12
→ ritajen: 了解,萬分感謝^^ 12/12 15:43
→ celestialgod: 幹,為什麼rep還是變成two... 12/13 15:45
→ ritajen: 對阿 依然會是two,自己改過就沒問題了 12/13 22:21