Skip to content

Inconsistent behaviour when manipulating a ts object with frequency = 12 or 4

3 messages · Brian Ripley, Simone Giannerini

#
Dear All,

I found the following  under R 2.3.0 on WINXP (tested on 2 PCs, I do
not have access to Linux from this PC, sorry ... )
Time Series:
Start = c(1, 1)
End = c(1, 6)
Frequency = 7
[1]  0.01874617 -0.18425254 -1.37133055 -0.59916772  0.29454513  0.38979430
Time Series:
Start = c(1, 1)
End = c(1, 6)
Frequency = 7
 [1]  0.01874617 -0.18425254 -1.37133055 -0.59916772  0.29454513
0.38979430          NA          NA          NA          NA          NA
[12]          NA          NA          NA          NA          NA
   NA          NA          NA          NA          NA          NA
[23]
## OK ********************
Jan        Feb        Mar        Apr        May        Jun
1 -1.2080762 -0.3636760 -1.6266727 -0.2564784  1.1017795  0.7557815
Error in matrix(c(rep.int("", start.pad), format(x, ...), rep.int("",  :
        length of 'dimnames' [1] not equal to array extent
In addition: Warning message:
data length [30] is not a sub-multiple or multiple of the number of
columns [12] in matrix
Qtr1        Qtr2        Qtr3        Qtr4
1 -0.23823356  0.98744470  0.74139013  0.08934727
2 -0.95494386 -0.19515038
Error in matrix(c(rep.int("", start.pad), format(x, ...), rep.int("",  :
        length of 'dimnames' [1] not equal to array extent
In addition: Warning message:
data length [26] is not a sub-multiple or multiple of the number of
rows [7] in matrix


Is this behaviour expected for frequencies 12 and 4?

Thank you

Simone

***************************************************
platform       i386-pc-mingw32
arch           i386
os             mingw32
system         i386, mingw32
status
major          2
minor          3.0
year           2006
month          04
day            24
svn rev        37909
language       R
version.string Version 2.3.0 (2006-04-24)
[1] "LC_COLLATE=English_United States.1252;LC_CTYPE=English_United
States.1252;LC_MONETARY=English_United
States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252"

______________________________________________________

Simone Giannerini
Dipartimento di Scienze Statistiche "Paolo Fortunati"
Universita' di Bologna
Via delle belle arti 41 - 40126  Bologna,  ITALY
Tel: +39 051 2098248  Fax: +39 051 232153
#
Attempting to change element 24 of a length 6 time series is inconsistent!
You end up with an invalid series, and the print methods are different for 
different frequencies, hence different error messages.

Please do not send the same post repeatedly!
On Wed, 31 May 2006, Simone Giannerini wrote:

            

  
    
#
many thanks for the reply,
On 5/31/06, Prof Brian Ripley <ripley at stats.ox.ac.uk> wrote:
of course it is, my post was also motivated by the fact that you
obtain different answers also  within the same frequency, depending on
the index,  for instance:
Jan        Feb        Mar        Apr        May        Jun
1  0.9255213  0.4829785 -0.5963106 -2.1852868 -0.6748659 -2.1190612
Jan        Feb        Mar        Apr        May        Jun        Jul
1  0.9255213  0.4829785 -0.5963106 -2.1852868 -0.6748659 -2.1190612         NA

so that I thought maybe it was worth pointing this out even if the
series are invalid.
I apologize, I thought there was a problem with the first post.
Regards,

Simone