- 1
- Arguments are named.
- 2
- Arguments are used by their position
- 3
- The function is used with default argument values
“Data analysts typically spend the majority of their time in the process of data wrangling compared to the actual analysis of the data.”
dplyr
dplyr
provides verbs for wrangling datamutate
(create) new variablesselect
variablesfilter
observationssummarise
valuesarrange
observations or rows1pipe_function(data = my.data, arg2 = "a", arg3 = "b", arg4 = "etc")
2pipe_function(my.data, arg2 = "a", arg3 = "b", arg4 = "etc")
3pipe_function(my.data)
data
|>
exists in base R%>%
is loaded with tidyverse
as part of the magrittr
packagelibrary(exscidata); library(tidyverse)
1model1 <- cyclingstudy %>%
2 filter(timepoint == "pre") %>%
3 mutate(VO2max.kg = VO2.max / weight.T1) %>%
4 lm(tte ~ VO2max.kg, data = .)
5summary(model1)