Knowing your Rs from your elbow

Steph Locke

2017-04-20

Steph Locke | Not my Rs

  • Star of presentations such as “the LaTeX show”!
  • Principal consultant at Mango Solutions
  • Local user group leader
  • blog: itsalocke.com
  • t: @stefflocke

What’s this about Rs?

  • R is an open source language, made out of the ashes of S
  • It started off stats
  • Now has excellent graphics, .js, & doc facilities

Why should you know your Rs from your elbow?

  • Great analysis
  • Reclaim your time from Excel
  • Markdown!
  • Interactive data viz via js libraries
  • Fully CI/CD capable

What does R look like? | Basics

#Define a variable
a<-25

#Call a variable
a
## [1] 25
#Do something to it
a+1
## [1] 26

What does R look like? | Functions

#Define a function
inflateAudienceFigs<-function(x) x*100

#Call a function
inflateAudienceFigs(a)
## [1] 2500

What does R look like? | Extensions

#Get a package
install.packages("data.table")

#Activate a package
library(data.table)

What does R look like? | Piping

library(magrittr)

#Typical
pairs(iris)

#Pipe
iris %>% pairs
iris %>% tail(.) %>% pairs
iris %>% {tail(.,nrow(.)/5)} %>% pairs

Find out more

Online

In-person

Get this presentation

This presentation is available on github.com/stephlocke/Rtraining. All the code is available for you to take a copy and play with to help you learn on the go.

If you have any questions, contact me!

itsalocke.com | github.com/StephLocke | @SteffLocke