Message-ID: <CAAmySGM3iGT0KEFTd8q9tPbZc5rM3=tdQNteuxHGj8JY7ZHuOw@mail.gmail.com>
Date: 2012-12-04T20:19:37Z
From: R. Michael Weylandt
Subject: Large loops in R
In-Reply-To: <CAH-FEnjrWJB=r9RhTGu32x1EKo8=Xc_83XeC_m256rQ2O+nv=g@mail.gmail.com>
On Tue, Dec 4, 2012 at 8:14 PM, Charles Novaes de Santana
<charles.santana at gmail.com> wrote:
> "Error in matrix(0, 48000, 48000) : too many elements specified"
>
> but I thought it was a machine limitation (and I was asking for access
> to a better machine in my labs...). Thanks for clarifying it.
>
> Well, when Sarah gave me the answer for my problem, I got a new one :)
> Thank you, Sarah and Peter.
>
> So, is there any other way to "trick R" and allocate such large matrices?
>
Either
1) Use the development version of R which has large-vector support
(matrices are vectors under the hood)
or
2) A large matrix is usually sparse in structure: use one of the many
sparse representation packages (e.g., Matrix) available.
MW