Re: [R] Summing over intervals

2010-07-15 Thread Patrick J Rogers
Hi Steven, You can just cut the matrix up into a 5 column matrix and use apply as normal m2<-matrix(as.vector(t(m)), ncol=5, byrow=TRUE) result<-matrix(apply(m2, 1, mean), ncol=ncol(m)/ncol(m2), byrow=TRUE) result -- Patrick Rogers Dept. of Political Science University of California, San Diego

[R] Java Heap Space Error while running kpca command

2010-07-14 Thread Patrick J Rogers
Hi All, I'm trying to run a kernel principal component analysis on a corpus with 89769 text documents. I'm using the kpca command from the kernlab package. Here is the code: output<-kpca(text, kernel=worddot(type="spectrum", length=1)) The problem is that when I run the kpca, it bails