Skip to content

Multivariate time series in R 3 vs R 2

5 messages · Martyn Plummer, Андрей Парамонов, Gabor Grothendieck

2 days later
#
This has nothing to do with changes in base R. It is due to changes in
the dependent packages. These changes mean that when you call lapply it
does not dispatch the right as.list method.

The method you want (as.list.ts) is provided by the zoo package. It
splits a multivariate time series into a list of univariate time series
in the way you are expecting.  Your package mar1s used to depend on zoo
indirectly through the fda package. But now fda does not depend on zoo,
it only suggests it. So now, when you load your package, zoo is not on
the search path and you get the default as.list method, which produces
the bad results.

The solution is to add "Imports: zoo" to your DESCRIPTION file and
"import(zoo)" to your NAMESPACE file.

Martyn
On Wed, 2013-10-23 at 22:56 +0400, ?????? ????????? wrote:
#
On Wed, Oct 23, 2013 at 2:56 PM, ?????? ????????? <cmr.pent at gmail.com> wrote:
I get the same results in R-2.14.0 and R-3.02.  They both give the
result shown above with the structures in the output.  I used
"R version 2.14.0 (2011-10-31)".

Try starting a clean session in R 2.14.0 using:

R --vanilla

and try it again.
1 day later