title: Writing Quadratic Function in R
body: <p>I am a beginner using R, and I am trying to write a simple quadratic function in R that accepts values for a, b, c and x and returns a value for y: y = a + bx + cx^2, and from that, create and save a vector, x, of 101 equally spaced values from -2 to 2 inclusive. Using the vector x just constructed, and the following values a = -1, b = 0, c = 1 with your function, calculate and save values for a vector, y.</p>
  
  <p>My code so far is below:</p>
  
  <pre><code>MyFunction &lt;- function(x){y = a + bx + cx^2^
  }
  x &lt;- seq(from = -2, to = 2, length.out = 101)
  print(x)
  a=-1
  b=0
  c=1
  </code></pre>
  
  <p>As you can see I have some of the basics down, but am having trouble put the pieces together. Any help is greatly appreciated! Thanks in advance.</p>