Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at intermountainmail.org
(801) 408-8111
> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch
> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of andy1983
> Sent: Monday, February 12, 2007 1:55 PM
> To: r-help at stat.math.ethz.ch
> Subject: [R] processing a large matrix
>
>
> I would like to compare every column in my matrix with every
> other column and get the r-squared.
>
> I tried using the following formula and looping through every column:
> > summary(lm(matrix[,x]~matrix[,y]))$r.squared
> If I have 10,000 columns, the loops (10,000 * 10,000) take
> forever even if there is no formula inside.
>
> Then, I attempted to vectorize my code:
> > cor(matrix)^2
> With 10,000 columns, this works great. With 30,000, R tells
> me it cannot allocate vector of that length even if the
> memory limit is set to 4 GBs.
>
> Is there anything else I can do to resolve this issue?
>
> Thanks.
> --
> View this message in context:
> http://www.nabble.com/processing-a-large-matrix-tf3216447.html
#a8932591
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at stat.math.ethz.ch 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.
>