Carbon Code Snippets

I recently learned today of carbon and it is absolutely fantastic.

In my own words, carbon provides a terminal-like formatting for your code snippets, which can be included in blog posts and the like. It just makes things easier to read, in my opinion.

Where my head goes is taking a snippet that looks like this:

options(stringsAsFactors = FALSE)

## load the packages
library(wakefield)

## generate a dataset of random users
users = r_data_frame(
  n = 500,
  id,
  state,
  date_stamp(name="registration_date"),
  dob,
  language
)
users$ID = as.numeric(users$ID)

Could look like below. It does not add a ton of value to the code itself, but the legibility and aesthetic does elevate the visual nature of the post.

Brock Tibert
Brock Tibert
Lecturer, Information Systems

Lecturer in Information Systems, Consultant, and nerd.