Comment detail
2次元ランダムウォーク (Nested Flatten)This comment is reply for 6870 186: なぜかRで 1-1と2-1は解いてませ...(2次元ランダムウォーク). Go to thread root.
もっといえば、1~4の乱数が欲しいようなときはrunif()ではなくsample()を使った方がRっぽいかもです。
1 | plot(cumsum(data.frame(x=c(1,-1,0,0), y=c(0,0,1,-1))[sample(4, t, replace=T),]), type="b")
|




pooq
#6896()
[
R
]
Rating1/1=1.00
Rating1/1=1.00-0+