[R] Generating and naming multiple time series

Michael Nahasapeemapetilon volarb at hotmail.com
Wed Aug 5 10:27:11 CEST 2009


Hi, 
I am trying to generate 100 different random walks each containing 500
variables.

The script I am using to develop one time series:
> x <- w <- rnorm(500)
> for (t in 2:500) x[t] <- x[t - 1] + w[t]

>From here I become stuck as I would like to generate a series and name it
Set1 for the first set, then Set2 for the second....Set(n)
I have tried rep() to generate the 100 time series and it works, but it
appears my issue is in naming and storing the sets.

The reason is that I would like to plot all 100 simulated sets onto one
graph.

If anyone has any hints/ideas for me to explore to achieve this, it is
greatly appreciated!

Thank you in advance.




More information about the R-help mailing list