title: Simulating time series random variable in R?
body: <p>I have to admit that I'm completely new to R. Thus, my question may be very simple.</p>
  
  <p>For an assignment, I need to simulate a random walk series. The initial position is a fixed point a on the real line. The first step is then taken with length X1 and the current position of the random walk process is changed to S(1)=a+X1. This process continues until n=1000.</p>
  
  <p>After generating the random variable X~N(1,10^2) 1000 times, I need to report the value of S(n) and show the plot of this random walk series. I also need to report the mean and variance of the series.</p>
  
  <p>This is what I have so far:</p>
  
  <pre><code>set.seed(1234)
  x&lt;-rnorm(1000,mean=1,sd=10)
  a&lt;--2
  </code></pre>
  
  <p>How do I generate an S so that I can have an S(n) for every n up to 1000? (I'm sorry if this is a very rudimentary question.)</p>