From KjetilBrinchmannHalvorsen at gmail.com  Fri Jun 16 22:23:00 2006
From: KjetilBrinchmannHalvorsen at gmail.com (KjetilBrinchmannHalvorsen at gmail.com)
Date: Fri, 16 Jun 2006 22:23:00 +0200 (CEST)
Subject: [Rd] bug in prcomp (PR#8994)
Message-ID: <20060616202300.066323F02E@slim.kubism.ku.dk>

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
2        2        7
3        3        8
4        4        9
5        5       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:
                PC1        PC2
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



[Rd] bug in prcomp (PR#8994)
KjetilBrinchmannHalvorsen at gmail.com