title: I am getting unexpected symbol error when I code a function
body: <p>Here is the code </p>
  
  <pre><code>reg&lt;-function(y,x){x&lt;-as.matrix(x) x&lt;-cbind(Intercept=1,x) solve(t(x)%*%x)%*%t(x)%*%y} 
  </code></pre>
  
  <blockquote>
    <p>Error: unexpected symbol in "reg&lt;-function(y,x){x&lt;-as.matrix(x) x"</p>
  </blockquote>
  
  <p>I get the same error even when I give line breaks and have spaces between the code elements</p>