title: I am getting the error 'Error: unexpected '}' in " }"'' . Where are my brackets misplaced?
body: <pre><code>N &lt;- 10000 ; 
  one_side_normal &lt;- function(N) {
    f &lt;- numeric(N);
    for (i in 1:N) {
      X = rexp(1,rate=1);
      uniform = runif(1);
      while (uniform&gt;exp((-X^2)+X) {
        X = rexp(1,rate=1);
        uniform=runif(1);
      }
      f[i] &lt;- X
    }
    return(f)
  }
  </code></pre>
  <p>My code is above. I'm trying to generate a random sample of 10000 from a one sided normal distribution using the acceptance-rejection method. Can you please highlight where the error with my parenthesis' are?</p>