title: Error: could not find function "accuracy"
body: <p>I want to check accuracy of what i predicted using linear regression.</p>
  
  <p>I'm using R studio and R.</p>
  
  <p>I want to use the accuracy function, however it keeps giving me:</p>
  
  <pre><code>Error: could not find function "accuracy"
  </code></pre>
  
  <p>I have done the following:</p>
  
  <pre><code>install.packages("forecast")
  install.packages("zoo")
  library("forecast")
  library("zoo")
  </code></pre>
  
  <p>I installed the required packages, but i still get the same result, what is the issue here, and what goes wrong?</p>
  
  <p>Code:</p>
  
  <pre><code>install.packages("forecast")
  install.packages("zoo")
  library("forecast")
  
  
     library("zoo")
  
  
  
   linearRegression2 &lt;- lm(formula = Average.Cost.for.two ~ Aggregate.rating, data = avgCostData)
   summary(linearRegression2)
       newData2 &lt;- data.frame(Aggregate.rating = c(3))
       predictAvgCost2 &lt;- predict(linearRegression2, newData2)
       predictAvgCost2
       accuracy(predictAvgCost2,avgCostData)
  </code></pre>