The R Novices badge; learn it before you earn it.
[1] "If you know R only as a letter from the alphabet, you'll be surprised to learn it is an entire language. That is, a programming language for statistical computing and graphics. In the We R Champions masterclass series, the We R Novices masterclass lays the foundation for the other masterclasses. You'll not only learn the R syntax and a bit of vocabulary, but also its primary data science dialect, the 'tidyverse'. Although we understand there are few things more exciting than R's syntax, you'll never grasp R without also touching upon the utterly boring things it enables you to do, such as interactive visualizations. Yawn. By the end of the masterclass we'll give you a sneak preview of what's to come in the rest of this series."
Our online version of an academic quarter. We’ll take five minutes for everyone to get in and get settled. Are you ready?
All done? Familiarize yourself with the document.
None.
But of course, I successfully…
Sections.
Text boxes.
Yeh
Nah
Everything you don’t (necessarily) need when working with the tidyverse, such as…
$, [], and [[]].for loops and if statements.Exactly, we don’t cover the things that most R learners find most difficult. Many of you will probably never miss it, but as for some of you it can be quite powerful, we’ll cover it in the We R Programmers masterclass.
The demonstration gives you the opportunity to see everything you’ll learn in harmony, before we break it apart into all the various building blocks that you can explore on your own.
# This script celebrates our first lines of R code
# Create cake object, which is added to environment tab
cake <- 3.14
cake
# Create slices vector
slices <- c(cake / 3, cake / 3, cake / 3) # a vector object
slices
# Plot slices with pie function
pie(x = slices) # warning: pie charts are ridiculous, only use them for celebrations
# Let's do it more efficiently
?"rep"
slices <- rep(x = cake / 3, times = 3)
slices
# Let's separate 'ingredients' from 'recipe'
n_participants <- 20
slice <- cake / n_participants
slices <- rep(x = slice, times = n_participants)
pie(x = slices)
# Now, let's give this cake a bit more body
library("plotrix") # first run install.packages("plotrix") once (we like to leave it out of our script)
plotrix::pie3D(x = slices, explode = .1, main = "There's cake for everyone!")