[Rd] bug in prcomp (PR#8994)

2006-06-16 Thread KjetilBrinchmannHalvorsen
The following seems to be an bug in prcomp():

  test - ts( matrix( c(NA, 2:5, NA, 7:10), 5, 2))
  test
Time Series:
Start = 1
End = 5
Frequency = 1
   Series 1 Series 2
1   NA   NA
227
338
449
55   10
  prcomp(test, scale.=TRUE, na.action=na.omit)
Erro en svd(x, nu = 0) : infinite or missing values in 'x'
  prcomp(na.omit(test), scale.=TRUE, na.action=na.omit)
Standard deviations:
[1] 1.414214e+00 3.726778e-17

Rotation:
PC1PC2
Series 1 0.7071068 -0.7071068
Series 2 0.7071068  0.7071068
 
note that
  is.matrix(test)
[1] TRUE

This is R2.3.1 pre-compiled binary from CRAN on windows XP.

  sessionInfo()
Version 2.3.1 (2006-06-01)
i386-pc-mingw32

attached base packages:
[1] methods   stats graphics  grDevices utils 
datasets  base


Kjetil

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] bug in ccf (PR#8893)

2006-05-23 Thread KjetilBrinchmannHalvorsen
This is R 2.3.0 from CRAN, windows XP.

The following looks like a bug in ccf():

  x - ts(rnorm(100), start=1)
  y - ts(rnorm(120), start=3)
  ccf(x,y)
Erro en na.fail.default(ts.union(as.ts(x), as.ts(y))) :
 missing values in object
  ccf(x,y, na.action=na.pass)
Erro en na.fail.default(as.ts(x)) : missing values in object


  sessionInfo()
Version 2.3.0 (2006-04-24)
i386-pc-mingw32

attached base packages:
[1] methods   stats graphics  grDevices utils 
datasets  base

other attached packages:
   zoo clim.pact akima  ncdf
   1.0-6   2.2-1   0.5-1 1.5

Kjetil

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] window() problem (PR#8545)

2006-01-31 Thread KjetilBrinchmannHalvorsen
window() does not work correctly when called with extend=TRUE  and
the new time range intersect null with the old time range! Maybe this is 
really a feature request, but the documentation does not say what to 
expect in this case.

This case does occur in programming!

This is R2.2.1 on windows, latest compiled from CRAN.

Look at the excerps below:

  test - ts(1:144, start=c(1,1), frequency=12)
  tsp(test)
[1]  1.0 12.91667 12.0
  test2 - window(test, start=c(5,1), end=c(16,4), extend=TRUE)
  test2
Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
5   49  50  51  52  53  54  55  56  57  58  59  60
6   61  62  63  64  65  66  67  68  69  70  71  72
7   73  74  75  76  77  78  79  80  81  82  83  84
8   85  86  87  88  89  90  91  92  93  94  95  96
9   97  98  99 100 101 102 103 104 105 106 107 108
10 109 110 111 112 113 114 115 116 117 118 119 120
11 121 122 123 124 125 126 127 128 129 130 131 132
12 133 134 135 136 137 138 139 140 141 142 143 144
13  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA
14  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA
15  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA
16  NA  NA  NA  NA
  tsp(test2)
[1]  5.00 16.25 12.00
  test3 - window(test, start=c(15,1), end=c(17,1), extend=TRUE)
Error in window.default(x, ...) : invalid time series parameters specified

Enter a frame number, or 0 to exit

1: window(test, start = c(15, 1), end = c(17, 1), extend = TRUE)
2: window.ts(test, start = c(15, 1), end = c(17, 1), extend = TRUE)
3: as.ts(window.default(x, ...))
4: window.default(x, ...)

Selection: 4
Called from: eval(expr, envir, enclos)
Browse[1] x
Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
11   2   3   4   5   6   7   8   9  10  11  12
2   13  14  15  16  17  18  19  20  21  22  23  24
3   25  26  27  28  29  30  31  32  33  34  35  36
4   37  38  39  40  41  42  43  44  45  46  47  48
5   49  50  51  52  53  54  55  56  57  58  59  60
6   61  62  63  64  65  66  67  68  69  70  71  72
7   73  74  75  76  77  78  79  80  81  82  83  84
8   85  86  87  88  89  90  91  92  93  94  95  96
9   97  98  99 100 101 102 103 104 105 106 107 108
10 109 110 111 112 113 114 115 116 117 118 119 120
11 121 122 123 124 125 126 127 128 129 130 131 132
12 133 134 135 136 137 138 139 140 141 142 143 144
Browse[1] tsp(x)
[1]  1.0 12.91667 12.0
Browse[1] y
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 
NA NA NA NA NA NA NA NA NA
[32] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
Browse[1] tsp(y)
NULL
Browse[1]

As one can see from the above, the calculated answer y does not have a
tsp attribute.

Kjetil

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel