I am looking for help with generating this plot from a sequence of ones and zeros, in R. I am using it as one of a battery of tests to investigate whether a sequence is random or not (by looking for patterns in the noise).
Note: This is not homework!
E.g.,
> y <- rnorm(3000, 1, 2)
> plot(y)
>plot(y~y)
My data is in this form:
>str(hv10k)
num [1:100000] 0 1 1 1 0 0 1 0 0 0 ...

Update:
Following @Roman Luštrik suggestions this is what I’ve got so far:
700 approx coin toss:

100,000 coin toss:

One way would be
EDIT
You can play with the
probargument insample.EDIT 2