Jump to my Home Page Send me a message Check out stuff on GitHub Check out my photography on Instagram Check out my profile on LinkedIn Check out my profile on reddit Check me out on Facebook

Mitch Richling: Example R Programs

Author: Mitch Richling
Updated: 2023-11-15

Table of Contents

1. Introduction

This collection of example code originates, for the most part, from a few Q&A seminars with new R users in 2015. The participants would ask 'How do I?', and I would do my best to demonstrate how I might do it with R. The files here are cleaned up versions of the transcripts of those R sessions along with added comments. Not a lot of math or statistics here. Mostly just R mechanics. At any rate, I posted them thinking that someone might find them useful. Update (2020): I have removed some of the older code here, and left things a more modern R user might actually use (ggplot, dplyer, etc…). I also converted everything to org-mode.

Get it all on github: https://github.com/richmit/ex-R/

2. The Code

ggplot
Some ggplot2 examples to get you started.
dplyr
Selecting, Sorting, Joining, …
cppInR
Define and use C++ functions in R code
dataTable
data.table
outliers
Simple outlier detection strategies with base R
parallelBasics
parallel
regression
Linear, non-linear, and polynomial regression with plots in one variable
tTests
Basic t-tests
timeSeries
time-series decomposition and smoothing with graphics