Blog

R

Dates and Times in R Without Losing Your Sanity

Dates and Times in R Without Losing Your Sanity

Working with dates and times in R can be frustrating! This isn’t R’s fault – dates and times are naturally complicated. One must consider time zones, leap years, leap seconds, Daylight Savings, hundreds of potential date and time formats, and other...
Spatial Data Analysis in R

Spatial Data Analysis in R

In this tutorial you will learn how to define geometries (points, lines, polygons) plot those geometries execute spatial joins (which points are contained in a polygon?) get the distance between a set of points do all of the above within the context of geospatial data...

Quick Guide to Regex in R

This guide is to help bridge the gap between understanding what a regular expression is and understanding how to use them in R. If you’re brand new to regular expressions, I highly recommend checking out RegexOne. Hadley Wickham’s stringr package makes...

R – Data.Table Rolling Joins

Rolling joins are commonly used for analyzing data involving time. A simple example – suppose you have a table of product sales and a table of commercials. You might want to associate each product sale with the most recent commercial that aired prior to the...

R – Introduction to Data.Table Joins

The data.table package in R provides fast methods for handling large tables of data with very simplistic syntax. The following is an introduction to the basic join operations available using the data.table package. Suppose you have two data.tables – a table of...

R – Introduction to Factors Tutorial

A factor variable (commonly called a categorical variable outside of R) is a variable that takes on a limited set of values. For example, days of the week {Sunday, Monday, etc.} or the set of colors {Red, Blue, Green} should be a factor. By contrast, a vector of...