Articles by William Doane

issuer: Local issue tracking, no net required

October 10, 2019 | William Doane

The goal of issuer is to provide a simple issue tracker, hosted on your local file system, for those users who don’t want to or are disallowed from using cloud-based code repositories. Online code repositories often provide an issue tracker to allow developers, reviewers, and users to report bugs, ... [Read more...]

Clean, Consistent Column Names

July 7, 2019 | William Doane

I like to standardize the column names of data I’m reading into R so that I don’t have to match column names from one dataset that has an i.d. column and another that has an id column or maybe an ID column. Keep it simple: lower case ... [Read more...]

Here is Your Data

June 1, 2019 | William Doane

It’s a common situation: you want to code and debug in R *and* leverage RMarkdown for a presentation or document. The challenge: file paths. Executing code in the console and from within a saved RMarkdown document typically requires distinct file paths to locate data files. While you’re writing ... [Read more...]

My RStudio Configuration

May 30, 2019 | William Doane

Whenever I need to install RStudio on a new machine, I have to think a bit about the configuration options I’ve tweaked. Invariably, I miss a checkbox that leaves me with slightly different RStudio behavior on each system. This post includes screenshots of my RStudio configuration and custom keyboard ...
[Read more...]

The Shiny Module Design Pattern

January 21, 2019 | William Doane

Foremost in your mind should be the quintessential reality of R: Everything that happens in R is the result of a function call. Shiny is no exception. To write a minimal shiny app, you create an object that describes your app’s user interface, write a function describing runtime behaviors, ... [Read more...]

Writing Pipe-friendly Functions

July 8, 2018 | William Doane

Pipes have been a fundamental aspect of computer programming for many decades. In short, the semantics of pipes can be thought of as taking the output from the left-hand side and passing it as input to the right-hand side. For example, in a linux shell, you might cat example.txt | ... [Read more...]

Three Deep Truths About R

June 29, 2018 | William Doane

Everything that exists in R is an object ~ John M. Chambers Everything that happens in R is the result of a function call ~ John M. Chambers Names have objects; objects don’t have names ~ Hadley Wickham So, what are the implications of these statements? Everything in R is an object ... [Read more...]

I’m ‘not in’ right now…

April 29, 2018 | William Doane

Checking whether an item is in a vector or not in a vector is a common task. The notation in R is a little inelegant when expressing the “not in” condition since the negation operator (!) is separated from the … Continue reading → [Read more...]

Defensively install packages in R

February 19, 2018 | William Doane

Often, your R code will rely on having one or more R packages available. A little defensive coding will save users of your code—including future-you—from having to figure out which packages you’re using and then having to manually install them. This … Continue reading → [Read more...]

Getting started with R

February 19, 2018 | William Doane

Download and install R. Download and install RStudio. Read R for Data Science. R provides the backend: the programming language specification and the interpreter. RStudio provides the frontend: the user interface that allows you to interact with R, visualize data, … Continue reading → [Read more...]

FizzBuzz in R

May 14, 2017 | William Doane

Functions are first class objects in R. Functions establish closures also known in R as environments. So, you can use functions to create other functions in creative ways. Here, I’ve written a function called divisor that returns a function that checks whether a given input, d, is evenly divisible ... [Read more...]

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)