[問題] 關於自訂函數
各位先進大家好小弟有個寫R上碰到的問題想請教各位大大?!
--R入門階段
> cum = function(v){
for(i in 1:v){
n = which(cumsum(runif(10))>1)[1]
print(n)
}
}
>cum(3)
[1] 3
[1] 2
[1] 3
產生出來的結果是我想要的但是我想把結果as.dataframe
卻無法,一直想出不解答想請各位大大幫幫忙~
謝大家
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.119.157.48
※ 文章網址: https://www.ptt.cc/bbs/R_Language/M.1429968235.A.4B7.html
→
04/25 21:42, , 1F
04/25 21:42, 1F
→
04/25 21:43, , 2F
04/25 21:43, 2F
→
04/25 21:54, , 3F
04/25 21:54, 3F
→
04/25 21:55, , 4F
04/25 21:55, 4F
→
04/25 21:55, , 5F
04/25 21:55, 5F
→
04/25 21:58, , 6F
04/25 21:58, 6F
→
04/25 21:58, , 7F
04/25 21:58, 7F
→
04/25 22:00, , 8F
04/25 22:00, 8F
→
04/25 22:01, , 9F
04/25 22:01, 9F
→
04/25 22:03, , 10F
04/25 22:03, 10F
→
04/25 22:05, , 11F
04/25 22:05, 11F
→
04/25 22:05, , 12F
04/25 22:05, 12F
→
04/26 11:50, , 13F
04/26 11:50, 13F
R_Language 近期熱門文章
PTT數位生活區 即時熱門文章