Press "Enter" to skip to content

Category: R

An Intro to R for the Excel User

Amieroh Abrahams explains some of the benefits of R:

The era of data manipulation and analysis using programming languages has arrived. But it can be tough to find the time and the right resources to fully switch over from more manual, time-consuming solutions, such as Excel. In this blog we will show a comparison between Excel and R to get you started!

When choosing between R and Excel, it is important to understand how both solutions can get you the results you need. However, one can make it an easy, reputable, convenient process, whereas the other can make it an extremely frustrating, time-consuming process prone to human errors.

I like this post as a way of showing current Excel users how R can perform a variety of tasks programmatically which they might do manually, though the it probably beats up on Excel too much. There’s a good reason why Excel is the single most important business tool out there and people who are deep into Excel can always break out DAX or M to perform operations.

Comments closed

Calibrating and Plotting a Time Series with healthyR.ts

Steven Sanderson builds a plot:

In time series analysis, it is common to split the data into training and testing sets to evaluate the accuracy of a model. However, it is important to ensure that the model is calibrated on the training set before evaluating its performance on the testing set. The {healthyR.ts} library provides a function called calibrate_and_plot() that simplifies this process.

Click through for the function’s input parameters and an example of how to use it.

Comments closed

Matrix Multiplication in R with DuckDB and SQLite

Karsten Weinert compares two databases:

On my laptop with 16 GB RAM, I would like to perform a matrix-vector multiplication with a sparse matrix of around 10 million columns and 2500 rows. The matrix has approximately only 2% non-zero entries, but this are still 500 million numbers and the column/row information, too large to work comfortably in-memory.

A while ago, I tried using sqlite for this task. It kind of worked, but was too slow to be useful. This weekend, I revisited the problem and tried using duckdb.

Read on for the results. I’ve heard enough positives about DuckDB over the past few weeks that it makes me want to try it out. H/T R-Bloggers.

Comments closed

tidyAML Now Available in CRAN

Steven Sanderson has a package make the big-time:

I’m excited to announce that the R package {tidyAML} is now officially available on CRAN! This package is designed to make it easy for users to perform automated machine learning (AutoML) using the tidymodels ecosystem. With a simple and intuitive interface, tidyAML allows users to quickly generate high-quality machine learning models without worrying about the underlying details.

Read on to learn more more about this package, as well as the broader healthyverse series of packages.

Comments closed

Visualizing Moving Averages in R with healthyR.ts

Steven Sanderson shows off a useful R library:

Are you interested in visualizing time series data in a clear and concise way? The R package {healthyR.ts} provides a variety of tools for time series analysis and visualization, including the ts_ma_plot() function.

The ts_ma_plot() function is designed to help you quickly and easily create moving average plots for time series data. This function takes several arguments, including the data you want to visualize, the date column from your data, the value column from your data, and the frequency of the aggregation.

Read on to learn more about this plot and see an example of it in action.

Comments closed

Making Star Maps in R

Benjamin Smith builds a map:

Continuing my explorations in developing custom map art, I decided to take a detour from developing the mapBliss package to explore another type of map which is very popular in the map-art space- star and constellation maps! This initially started out as an issue opened on the mapBliss Github. However, I quickly realized the framework required for making star maps is completely different from making regular maps for custom fight paths and road trips.

Read on to learn more about the problem and what libraries are available to help in R.

Comments closed

Cumulative Measurement Functions in R

Steven P. Sanderson provides an overview of an R package:

If you’re looking for an easy-to-use package to calculate cumulative statistics in R, you may want to check out the TidyDensity package. This package offers several functions to calculate cumulative measurements, including mean, median, standard deviation, variance, skewness, kurtosis, harmonic mean, and geometric mean.

Click through for a quick description of each function, as well as examples of each. H/T R-Bloggers.

Comments closed

Diagnosing VSCode + R Integration Problems

John MacKintosh troubleshoots an issue:

I recently updated my R installation, and then realised that I’d broken my VSCode/ R set up in the process – I could not launch an R terminal either directly or via radian.

I have a repo where I’ve collated various blog posts relating to setting up VSCode for R, but that didn’t solve all my problems.

I did get it resolved eventually, and here’s how.

Read on for that resolution. H/T R-Bloggers.

Comments closed

Organizing R Code

Tomaz Kastrun tidies up:

Keeping your R code organised is not as straightforward as one might think. Just think about the libraries, variables, functions, and many more. All these objects can be defined and later rewritten, some might get obsolete during the process.

This process is proven to be even more crucial when you are part of a larger group of engineers, and scientists, who collaborate with you.

Click through for some organizational tips specific to R code.

Comments closed