%>%
Galton summarize(vh = var(height), vm = var(mother), vf = var(father))
vh | vm | vf |
---|---|---|
12.8373 | 5.322365 | 6.102164 |
Within R, names of functions, data frames and variables are not in quotes. Quotes are used to identify text content.
functions: The verbs of R. Functions transform an input to produce an output. Examples: lm()
, model_eval()
pipeline: passes output of a function into another function
%>%
token, which can never be at the start of a line.Dataframe %>% fun1(args) %>% fun2(args)
Result <- Dataframe %>% fun1(args) %>% fun2(args)
data frames: hold data. Columns are variables.
data=____
arguments: specifies “details” of the calculation
named argument. Just a specific form of argument that looks like name =
. There will always be an equals sign.
variable
sum()
, var()
, mean()
The parts of speech.
Common objects that we use: data frames, tilde expressions, aes() versus map()
%>%
Galton summarize(vh = var(height), vm = var(mother), vf = var(father))
vh | vm | vf |
---|---|---|
12.8373 | 5.322365 | 6.102164 |
Hill_racing %>% lm(time ~ distance + climb, data=.) %>% regression_summary()
model_eval(modD, dow=week, day=28, interval=“prediction”)
model_plot(mod, x=father)