In some ways this is better, and in others it is much worse. Using named constants instead of magic numbers, and breaking up complex logic into simpler named parts is a huge win for readability/maintainability, as any programmer quickly learns. The big one liner would be a lot nicer in about 3-4 chunks.<p>I’d rewrite this example as something like:<p><pre><code> num.steps <- 1000
num.walks <- 100
step.std.dev <- 0.03
start.value <- 15
rand.row <- function() rnorm(num.steps, 1, step.std.dev)
walk <- function () cumprod(rand.row()) * start.value
all.walks <- t(replicate(100, walk()))
plot(colMeans(all.walks), type = "l")
</code></pre>
[I’m not an R guy, so that might not be the most typical style ever, but you get the idea...]