[R] acf(ts.union()): Missing Values in Object

Rich Shepard rshepard at appl-ecosys.com
Wed Mar 26 23:07:33 CET 2014


   I have 2 time series (class 'ts') and I want to plot the acf for each and
the joint ccf using acf(ts.union(ts1, ts2)).

   According to the ts.union help, "‘ts.union’ pads with ‘NA’s to the total
time coverage" but the problem seems to be that one series has a single NA
while the other has 2 NAs. Both series have 792 rows of (date, value).

   The command and R's response are:

acf(ts.union(dalles.disch.ts, dalles.temp.ts))
Error in na.fail.default(as.ts(x)) : missing values in object

   Is there a way to massage the data so ts.union() accepts the input and
passes it properly to acf()?

   Subsets of the data via dput()

discharge:

c(162000L, 127000L, 151000L, 172000L, 136000L, 150000L)

temperature:

c(5, 5, 4.9, 4.9, 5, 5.1)

TIA,

Rich



More information about the R-help mailing list