The Zen of R
gist.github.com
The Zen of R
1–10 of 28 posts
Re: The Zen of R
#2Re: The Zen of R
#3Re: The Zen of R
#4Re: The Zen of R
#5The most of this Zen comes from array paradigm, not functional; still it is nice to see another soul on the path to Renlightenment (-;
Here he is computing the history of states of a random walk as scan (*) initial updates. If you wanted to simulate branching random walks, you'd work over the data type of multiway trees instead of arrays, but the algorithm to compute the history of intermediate states would otherwise be identical, using the scan function for multiway trees.
Re: The Zen of R
#6Re: The Zen of R
#7Re: The Zen of R
#8How did that take a couple months? Even in R's slightly awkward language, random walks shouldn't be very difficult! I'm baffled, I must be missing something.
Re: The Zen of R
#9I’d rewrite this example as something like:
num.steps
[I’m not an R guy, so that might not be the most typical style ever, but you get the idea...]Re: The Zen of R
#10How did that take a couple months? Even in R's slightly awkward language, random walks shouldn't be very difficult! I'm baffled, I must be missing something.