title: Error in autocorrelation function (ACF): Missing values in object
body: <p>I am working on a time-series data that has structure as follow:</p>
  
  <pre><code>str(tseries)
   Time-Series [1:479] from 1979 to 2019: 0.0258 0.0234 0.0055 0.0302 0.0305 0.0232 0.025 0.0234 0.0074 0.0089 ...
  </code></pre>
  
  <p>I am trying to conduct time-series analysis and therefore use the autocorrelation function (ACF). First it was able to return the plot when run:</p>
  
  <pre><code>acf(tseries)
  </code></pre>
  
  <p>Yet it gave me an error when I tried to execute differentiated and logged acf() function:</p>
  
  <pre><code>&gt; acf(diff(log(tseries)))
  Error in na.fail.default(as.ts(x)) : missing values in object
  In addition: Warning message:
  In log(tseries) : NaNs produced
  </code></pre>
  
  <p>What does the missing values it refer to? Because I have made sure that the data set I am working on has no missing values at all, if that's what it means.</p>