Steph Locke
2017-04-20
#Define a variable
a<-25
#Call a variable
a
## [1] 25
#Do something to it
a+1
## [1] 26
#Define a function
inflateAudienceFigs<-function(x) x*100
#Call a function
inflateAudienceFigs(a)
## [1] 2500
#Get a package
install.packages("data.table")
#Activate a package
library(data.table)
library(magrittr)
#Typical
pairs(iris)
#Pipe
iris %>% pairs
iris %>% tail(.) %>% pairs
iris %>% {tail(.,nrow(.)/5)} %>% pairs
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!