# NOT RUN {
orig.dir <- getwd(); setwd(tempdir()); # move to temporary dir
if(file.exists("testMyBig.bck")) { unlink(c("testMyBig.bck","testMyBig.dsc")) }
mat2 <- sim.cor(500,200,genr=function(n){ (runif(n)/2+.5) })
bmat2 <- as.big.matrix(mat2,backingfile="testMyBig.bck",
descriptorfile="testMyBig.dsc", backingpath = getwd())
## calculate PCA ##
# }
# NOT RUN {
result2 <- big.PCA(bmat2,thin=FALSE)
corrected <- PC.correct(result2,bmat2)
corrected2 <- PC.correct(result2,bmat2,n.cores=2)
c1 <- get.big.matrix(corrected) ; c2 <- get.big.matrix(corrected2)
all.equal(as.matrix(c1),as.matrix(c2))
# }
# NOT RUN {
rm(bmat2)
unlink(c("testMyBig.bck","testMyBig.dsc"))
setwd(orig.dir) # reset working dir to original
# }
Run the code above in your browser using DataLab