title: How to make a regression line in R using a normally distributed error and a uniformly distributed random variable
body: <p>I am very new in using R and my first task is to try and find 100 points and fit a <a href="https://i.stack.imgur.com/uWC6M.png" rel="nofollow noreferrer">regression line</a> as y=5 + 3*x + e with x uniformly distributed and e normally distributed. I have some experience with Python, but I'm having a bit of a hard time understanding R syntax.</p>
  
  <pre><code>xvals = runif(n = 100, min = -1, max = 1)
  evals = rnorm(n = 100, mean = 0, sd = 1)
  y&lt;- c()
  for (x in xvals) {
    for (e in evals) {
      append(y, 5 + 3*x + e)
    }
  }
  
  print(y)
  </code></pre>
  
  <p>I tried this but y seems empty. Can anyone let me know how to solve this? Also, if anyone can recommend any resources that could help besides R documentation, please let me know!</p>