This presentation was made in RStudio using RMarkdown!
- Can set
output: ioslides_presentation
in the header
2/9/2018
This presentation was made in RStudio using RMarkdown!
output: ioslides_presentation
in the headerR commands are like sentences:
draw(picture, recipient = "me", material = "paint")
Component | Role |
---|---|
draw | function |
picture | argument value |
recipient | argument name |
"me" | argument value |
material | argument name |
"paint" | argument value |
%>%
)takes the thing on the left, and (by default) puts it (or its output, if it is a function call) into the first argument slot for the function on the right
We'll do a lot more with this later
## Two equivalent expressions arbuthnot %>% mutate(total = boys + girls) mutate(arbuthnot, total = boys + girls)
mutate()
function## Creates the column, but it immediately disappears mutate(arbuthnot, total = boys + girls) ## Creates the column, and creates a brand new data frame ## that has both new and old variables (now we have two ## data frames, one with and one without the new variable) new.arbuthnot <- mutate(arbuthnot, total = boys + girls) ## Creates the column, and overwrites the original data ## with a data frame that has new and old columns arbuthnot <- mutate(arbuthnot, total = boys + girls)
Source: Nathan Yau, Data Points