title: How do I find the root mean squared error in R?
body: <p>I'm trying to find the root mean squared error on a ksvm model and also plotting the results using the <code>airquality</code> dataframe. This is what I have so far:</p>
  
  <pre><code>library(kernlab)
  library(ggplot2)
  AQ &lt;- airquality
  
  set.seed(1)
  randIndex &lt;- sample(1:dim(AQ)[1])
  cutPoint2_3&lt;- floor(2 * dim(AQ)[1]/3)
  cutPoint2_3
  TrainAQ &lt;- AQ[randIndex[1:cutPoint2_3],]
  TestAQ &lt;- AQ[randIndex[(cutPoint2_3+1) :dim(AQ)[1]],]
  
  svmOutput &lt;- ksvm(Ozone ~., data=TrainAQ, kernel = "rbfdot", 
  kpar='automatic',C=5,cross=3, prob.model=TRUE)
  
  #Test the model on the testing dataset, and compute the Root Mean Squared    Error
  svmOutputtest &lt;- ksvm(Ozone ~., data=TestAQ, 
                        kernel = "rbfdot",
                        kpar="automatic",
                        C=5,
                        cross=3,
                        prob.model=TRUE)
  
  #root mean squared is ?
  
  #Plot the   results. Use a scatter  plot. Have the  x-axis  represent    temperature, the   y-axis  represent   wind,   the point   size    and color    represent  the error,  as  defined by  the actual  ozone   level minus the  predicted  ozone   level).
  ggplot(AQ,aes(x=Temp,y= Wind,color=svmOutput$Error,shape=svmOutput$Error)) +geom_point(size=5)
  </code></pre>