Do More With R [video hero/video series] - R Programming Guide - Tips & Tricks

Here are some of the best tips, tricks, and takeaways for R users from this year’s rstudio::global(2021) virtual conference:

Speed up your R code

The new xrprof package builds on code profiling (performance measuring) offered by base R’s Rprof() with these added features:

  • It can run on a remote server, not just locally, allowing you to see what’s happening in your production environment;
  • It can see bottlenecks in C/C++ code, not just R code — especially useful for R package developers using C or C++.

And, it’s a drop-in replacement for the ecosystem of Rprof() add-on tools, said author Aaron Jacobs, senior data scientist at Crescendo. This project was funded in part by the R Consortium.

Customize your R data visualizations

The thematic package lets you customize plot defaults for ggplot2, lattice, and base R graphics. It works within RStudio, R Markdown documents, and Shiny apps. thematic dataviz code might look something like this:

thematic_on(bg = "#222222", fg = "white", accent = "#0CE3AC", font = "Oxanium")

before running a plot. The package includes support for Google fonts.

Improve your R Markdown docs & Shiny apps

Customize design

The bslib package aims to make it easier to create custom themes for Shiny apps and R Markdown documents. It should be on CRAN soon, but meanwhile it’s available to install via remotes::install_github("rstudio/bslib"), according to RStudio’s Thomas Mock. This is a successor to the older bootstraplib package. 

Copyright © 2021 IDG Communications, Inc.

Source link


Please enter your comment!
Please enter your name here