Blog Archives

Label line ends in time series with ggplot2

September 25, 2018
By
Label line ends in time series with ggplot2

@drsimonj here with a quick share on making great use of the secondary y axis with ggplot2 – super helpful if you’re plotting groups of time series! Here’s an example of what I want to show you how to create (pay attention to the numbers of the ...

Read more »

Exploring correlations in R with corrr

August 21, 2018
By
Exploring correlations in R with corrr

@drsimonj here to share a (sort of) readable version of my presentation at the amst-R-dam meetup on 14 August, 2018: “Exploring correlations in R with corrr”. Those who attended will know that I changed the topic of the talk, originally advertised...

Read more »

Does financial support in Australia favour residents born elsewhere? Responding to racism with data

May 30, 2018
By
Does financial support in Australia favour residents born elsewhere? Responding to racism with data

Seeing a racist outburst made me wonder whether the Australian Government unfairly supports people based on their background. Using data from the Australian Government and Bureau of Statistics, I couldn’t find compelling evidence of this being true. Don’t believe me? Read on and see what you make of the data.  Australian racism goes viral, again Australian racism went viral again this...

Read more »

Guide to tidy git analysis

March 26, 2018
By
Guide to tidy git analysis

@drsimonj here to help you embark on git repo analyses! Ever wondered who contributes to git repos? How their contributions have changed over time? What sort of conventions different authors use in their commit messages? Maybe you were inspired by Mara Averick to contribute to tidyverse packages and wonder how you fit in? This post – intended for intermediate R users...

Read more »

Creating corporate colour palettes for ggplot2

February 26, 2018
By
Creating corporate colour palettes for ggplot2

@drsimonj here to share how I create and reuse corporate color palettes for ggplot2. You’ve started work as a data scientist at “drsimonj Inc” (congratulations, by the way) and PR have asked that all your Figures use the corporate colours. They send you the image below (coincidentally the Metro UI colors on color-hex.com): You want to use these colours with ggplot2...

Read more »

Five tips to improve your R code

December 30, 2017
By
Five tips to improve your R code

@drsimonj here with five simple tricks I find myself sharing all the time with fellow R users to improve their code! This post was originally published on DataCamp’s community as one of their top 10 articles in 2017  1. More fun to sequence from 1 Next time you use the colon operator to create a sequence from 1 like 1:n, try seq(). #...

Read more »

ggplot2 SEM models with tidygraph and ggraph

October 2, 2017
By
ggplot2 SEM models with tidygraph and ggraph

@drsimonj here to share a ggplot2-based function for plotting path analysis/structural equation models (SEM) fitted with Yves Rosseel’s lavaan package.  Background SEM and its related methods (path analysis, confirmatory factor analysis, etc.) can be visualized as Directed Acyclic Graphs with nodes representing variables (observed or latent), and edges representing the specified relationships between them. For this reason, we will use Thomas...

Read more »

Big Data Solutions: A/B t test

August 14, 2017
By

@drsimonj here to share my code for using Welch’s t-test to compare group means using summary statistics.  Motivation I’ve just started working with A/B tests that use big data. Where once I’d whimsically run t.test(), now my data won’t fit into memory! I’m sharing my solution here in the hope that it might help others.  In-memory data As a baseline, let’s start with an...

Read more »

A tidy model pipeline with twidlr and broom

June 1, 2017
By
A tidy model pipeline with twidlr and broom

@drsimonj here to show you how to go from data in a data.frame to a tidy data.frame of model output by combining twidlr and broom in a single, tidy model pipeline.  The problem Different model functions take different types of inputs (data.frames, matrices, etc) and produce different types of output! Thus, we’re often confronted with the very untidy challenge presented in...

Read more »

Pretty scatter plots with ggplot2

May 15, 2017
By
Pretty scatter plots with ggplot2

@drsimonj here to make pretty scatter plots of correlated variables with ggplot2! We’ll learn how to create plots that look like this:  Data In a data.frame d, we’ll simulate two correlated variables a and b of length n: set.seed(170513) n 2 0.9133158 0.21116682 #__ 3 1.4516084 0.69060249 #__ 4 0.5264596 0.22471694 #__ 5 -1.9412516 -1.70890512 #__ 6 1.4198574 0.30805526  Basic...

Read more »

Search R-bloggers


Sponsors

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)