R 4.5.1 – Batteries Included

[This article was first published on pacha.dev/blog, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

If this post is useful to you I kindly ask a minimal donation on Buy Me a Coffee. It shall be used to continue my Open Source efforts.

You can send me questions for the blog using this form and subscribe to receive an email when there is a new post.

R Batteries Included detects your CPU cores and configures itself for maximum performance. I created this to assist some lab colleagues who were struggling with the R setup on their Windows machines.

The installer includes OpenBLAS for faster linear algebra operations and the components required to install packages from source (e.g., from GitHub).

Your existing code works exactly the same, just faster, and does not requires changes to existing workflows.

Whether you’re analyzing large datasets, running simulations, or building statistical models, this is the easiest performance upgrade you’ll ever make.

Download link:

https://github.com/pachadotdev/r-batteries-included/releases/download/4.5.1/R-4.5.1-Batteries-Included.exe

Optional donation for the time to create and test the installer:

BuyMeACoffee


If you install vanilla R and try to install a package with compiled code (e.g., a package with C++ code from GitHub), you may see errors like this:

> remotes::install_github("pachadotdev/kendallknight")

In missing_devel_warning(pkgdir) :
  Package kendallknight has compiled code, but no suitable compiler(s) were found. Installation will likely fail.
  Install Rtools (https://cran.r-project.org/bin/windows/Rtools/).Then use the pkgbuild package, or make sure that Rtools in the PATH.

With R Batteries Included, the installation works out of the box:

> remotes::install_github("pachadotdev/kendallknight")

Installing package into ‘C:/Users/vboxuser/AppData/Local/R/win-library/4.5’
(as ‘lib’ is unspecified)
cpp4r/include'   -I"c:/rtools45/x86_64-w64-mingw32.static.posix/include"   -fopenmp   -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign    -c cpp4r.cpp -o cpp4r.o
g++ -std=gnu++17  -I"C:/R/R-45~1.1/include" -DNDEBUG  -I'C:/Users/vboxuser/AppData/Local/R/win-library/4.5/cpp4r/include'   -I"c:/rtools45/x86_64-w64-mingw32.static.posix/include"   -fopenmp   -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign    -c kendall_correlation.cpp -o kendall_correlation.o
g++ -std=gnu++17 -shared -s -static-libgcc -o kendallknight.dll tmp.def cpp4r.o kendall_correlation.o -fopenmp -Lc:/rtools45/x86_64-w64-mingw32.static.posix/lib/x64 -Lc:/rtools45/x86_64-w64-mingw32.static.posix/lib -LC:/R/R-45~1.1/bin/x64 -lR
* DONE (kendallknight)

The default installation path is C:\R. You can remove other R installations to avoid confusion, but it’s not required.

Works with RStudio and Visual Studio Code.

I hope it’s useful!

To leave a comment for the author, please follow the link and comment on their blog: pacha.dev/blog.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)