title: Error in 'ts' object must have one or more observations
body: <p>I have a problem running this code, it always displays this error: 'ts' object must have one or more observations. </p>
  
  <pre><code>library('forecast')
  library('tseries')
  library('urca')
  
  
  dataset_180days &lt;- read.csv(file.choose())
  
  head(dataset_180days)
  
  # Timeseries data 
  Yts_180days=ts(dataset_180days$Actual) #used to create time-series objects.
  
  # ^--- this is where the error occurs.
  
  # Augmented Dickey-Fuller Test Unit Root / Cointegration Test 
  udf_test_180days &lt;- ur.df(Yts_180days) #computes the augmented Dickey-Fuller test
  summary(udf_test_180days)
  
  # Ljung-Box Test
  LB_test_180days &lt;- Box.test(Yts_180days, type='Ljung-Box') # test statistic for examining the null hypothesis of independence in a given time series
  print(LB_test_180days)
  
  # Augmented Dickey-Fuller (ADF) t-test
  
  adf_test_180days &lt;- adf.test(Yts_180days,alternative = 'stationary')
  print(adf_test_180days)
  </code></pre>
  
  <p>Thank you </p>
  
  <p>Attached please find the dataset.</p>
  
  <p><a href="https://www.dropbox.com/s/1cmwf4dema1jemw/January-2012.csv?dl=0" rel="nofollow noreferrer">https://www.dropbox.com/s/1cmwf4dema1jemw/January-2012.csv?dl=0</a></p>