[R] Different PCA results under Windows and Linux
Steven McKinney
smckinney at bccrc.ca
Wed Sep 17 03:13:13 CEST 2008
Not likely that anyone can explain, as
there is not enough information in your
email.
Including the contents of the freqtest.txt file
was a good idea, as the posting guide suggests
(the posting guide is that clearly labeled bit
at the bottom that looks like this:
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
Check it out! It is cool.)
Additionally, include the command
sessionInfo()
and its output from all machines you refer to
so maintainers know which versions of software
you are running. Also, include the output you obtained
from your code (with your code being a self-contained
and reproducible set of R commands).
Finally, describe what the difference is and why
the difference is problematic (i.e. don't report
machine precision differences, or sign differences
for PCA results - PCA vector directions are arbitrary
modulo 180 degrees).
> I also tried mean(xrcc2) and sd(xrcc2) on both machines, the results are the
> same.
> Please explain.
The R maintainers do an amazing job of creating
numerically stable platform-independent software,
so you get the same results almost everywhere.
(Thank you R core!)
HTH
Steve McKinney
-----Original Message-----
From: r-help-bounces at r-project.org on behalf of jathine
Sent: Tue 9/16/2008 2:19 PM
To: r-help at r-project.org
Subject: [R] Different PCA results under Windows and Linux
I ran the following R script under both Linux and Windows, and got 2
different results.
Linux R version 2.7.1 and Windows R version 2.7.2.
> library(FactoMineR)
>x1=read.table("freqtest.txt",header=TRUE)
>xrcc2=x1[,1:8]
>p1=PCA(xrcc2, graph=FALSE)
>p1$var
freqtest.txt file lines of text :
M1 M2 M3 M4 M5 M6 M7 M8
-1 -1 -1 -1 -1 -1 -1 -1
0 0 0 0 -1 -1 1 1
-1 -1 -1 -1 -1 -1 -1 -1
0 0 0 0 -1 -1 1 1
I also tried mean(xrcc2) and sd(xrcc2) on both machines, the results are the
same.
Please explain.
--
View this message in context: http://www.nabble.com/Different-PCA-results-under-Windows-and-Linux-tp19520449p19520449.html
Sent from the R help mailing list archive at Nabble.com.
______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
More information about the R-help
mailing list