For cycles in R and computational speed

In the past, I wrote R code that requires for loops inside for loops. Usually this code is quite laborious to execute. I read online, this is the result of how loops work in R. I also read that using loops in another language inside R eg C ++ or Java can speed up the computational time.

Does anyone have any experience with this and can point me to some simple examples that I can read?

You can also call a different language for the for loop, but still, everything inside the loop should be in standard R code?

0
source share
2 answers

, , C, .

-, , R Stackoverflow. , R , . , R Inferno, , .

, , , , , ( .., : ?

( : , , R C, , R, C. , - , , , , double for. , , , .)

, , R, - R . , R. The Art of R Programming, . pdf- ; . , , pdf; .

, , C R, .C .Call. .C, , , , , , , .

- , .C , , . , , C, void, . C, , , C Programming in Easy Steps. , , , , C . .

.C " ", UNIX. , Windows; , , Windows - , , , , . , , , , Windows, .

.C Windows, , . , , , .

.C .Call Rcpp. Dirk Edelbuettel, , Stackexchange , , , R/C. , , , . , Windows.

, , for , R- , , , , , R for , , . , R C, R.h. , Windows. , Rtools. , C , R-.

, , . R- . Rcpp. , - , .C. , , , -, .

+6

R, R, , , , , , .

R , , apply - bugbear -

, , .

, , , , , , , .

, Rccp inline, , vanilla R.

.

+4

All Articles