ggplot

my favourite things about R

I am prepping a talk for R-Ladies Sydney about my favourite R things, the packages and functions that end up in every script I write.

how to use colour palettes with ggplot

Series: IDHTG

If I had a dollar for everytime I have googled how to change the colours in my ggplot…it is clearly time for a “I don’t have to google” post about it. library(tidyverse) library(palmerpenguins) library(RColorBrewer) library(harrypotter) penguins <- penguins make a couple of basic plots When dealing with geom_point(), you can use colour to change the colour of the points. For geom_col(), you need to use fill; colour will change the border around your bars.

how to annotate plots

Series: IDHTG

A new post in my I Don’t Have to Google (IDHTG) series. I’ve been wanting to work out how to add annotations to plots for a while and this plot from the @WeAreRladies account this week got me inspired! I also looked at activity by week. You can see that there are some weeks when there was a break between curators. You can also see curators are totally different - both in terms of number of tweets and the number of retweets and replies.

apa figures

As I write my first paper reporting data analysis coming out of R (woot!!!), here are some notes summarising all the googling I have done this morning about how to produce APA style figures in ggplot. via GIPHY Load libraries Start by loading tidyverse to get ggplot, here to make finding the data easy, and papaja to get the theme_apa() function. library(tidyverse) library(here) library(papaja) Read in data plotdata <- read_csv("plotdata.

how to add a gif

Sometimes your plot needs a celebratory gif. I have just finished the vizwhiz module for #RYouWithMe and to top off the series I worked out how to add an RLady Wizard to our final plot. Just so I’ll remember for next time, here is a step by step how to… knitr::include_graphics("beachwiz.gif") how to add a gif to your ggplot Install the magick package and load it with ggplot.