Skip to content
Back to formatted view

Raw Message

Message-ID: <489374A1-4E14-4BB2-8742-F5EA91FD8DAD@gmail.com>
Date: 2012-12-04T18:54:10Z
From: michael.weylandt at gmail.com (R. Michael Weylandt
Subject: Large loops in R
In-Reply-To: <CAH-FEni1cG=B7oRNjCOSUs+shvig0GiK9D9N8ukvOWM5hhjPJQ@mail.gmail.com>

On Dec 4, 2012, at 6:47 PM, Charles Novaes de Santana <charles.santana at gmail.com> wrote:

> Dear all,
> 
> I need to access data from a large matrix (48000 x 48000) and to do it
> I am trying to run two loops using "for" command. Surely it is been a
> very slow job.
> 
> I heard that "for" is not the best option to perform large loops in R,
> but I don't really know what would be the best (fast) option. sapply?
> vapply? Could anyone help me with this issue, please?

What exactly are you trying to do? It's likely doable with a few vectorized operations. 

Michael 


> 
> Thank you very much for your attention and for any help!
> 
> Best regards,
> 
> Charles
> 
> -- 
> Um ax?! :)
> 
> --
> Charles Novaes de Santana
> http://www.imedea.uib-csic.es/~charles
> PhD student - Global Change
> Laboratorio Internacional de Cambio Global
> Department of Global Change Research
> Instituto Mediterr?neo de Estudios Avanzados(CSIC/UIB)
> Calle Miquel Marques 21, 07190
> Esporles - Islas Baleares - Espa?a
> 
> Office phone - +34 971 610 896
> Cell phone - +34 660 207 940
> 
> ______________________________________________
> 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.