> system.time(vec1 <- rnorm(1000000))
user system elapsed
0.200 0.000 0.199
My computer takes .2 seconds to generate the million random normals and assign them to vec1. > vec1 = rnorm(1000000)
> system.time(vec1)
user system elapsed
0 0 0
My computer only takes 0 seconds to evaluate the existing vec1 of length one million. system.time(vec1 <- rnorm(1000))
mean(vec1)
system.time(vec2 = rnorm(1000))
mean(vec2)
And to demonstrate that you need to use '=' for argument passing: x <- c(3,4,NA)
mean(x)
mean(x, na.rm=TRUE)
mean(x, na.rm<-TRUE)
[1] Type help('=') at an R prompt, or view it online: http://stat.ethz.ch/R-manual/R-patched/library/base/html/ass...
"For Markov chains to be effective the current state has to be dependent on the previous state in some way;"
This is trivially untrue. A sequence of independently and identically distributed (iid) random variables is a Markov chain. An iid sequence is clearly effective at many things (e.g. Monte Carlo integration).
"Not every process has the Markov Property, such as the Lottery, this weeks winning numbers have no dependence to the previous weeks winning numbers." As lambdaphage pointed out, the Lottery does have the Markov property.