Any documentation for optimizing R performance?

I am new to R, and one thing that struck me is that it works quite slowly. Is there any documentation for optimizing R? For example, Python optimization is described very well here . In my particular case, I am interested in optimizing R for batch jobs.

Of course, I tried Google for Google, but it’s not so easy for Google for R information, since R is a pretty general search pattern.

+7
source share
4 answers

Yes, R is a little inconvenient for a search query, so try RSiteSearch ("performance") in R - this will look in most sources for R docs.

+5
source

To get started, you should take a look at Patric Burns' R Inferno .

The best thing to ask here is more detailed questions.

+9
source

A simple google search for “efficient programming in r” reveals the following excellent resources. the first resource is great because it provides a comparison of the bad, good and better ways of programming a task in R. The second resource is more general.

If you are looking for more specific areas of optimization for your R-code, indicate it more clearly, and I am sure that you will find an expert here!

+3
source

“It works pretty slow” is very vague. There are many methods for the most efficient use of R, the general rule is to “avoid loops and vectorization,” but there are many more, for example, so that objects are pre-distributed and not changed on the fly.

It really depends on what you are doing, so please be more specific. There are a lot of basic tips in the standard documentation, and your question does not allow anyone to do more than tear them down.

When the standard R is really limited for your needs, you can write directly in a compiled language like C, or use advanced interfaces like Rcpp. For other tools and methods that go beyond the core R toolkit, refer to the CRAN task view.

+2
source

All Articles