Use of Tilde (~) and period (.) in R
问题 I'm going over looping with tidyverse and purrr using Hadley's R4DS book and am a little confused as to the exact usage of the tilde ~ symbol and period symbol. So when writing for loops, or using map(), instead of writing out function(), it appears you can use the tilde symbol instead ~. Does this only apply to for loops? so as below... models <- mtcars %>% split(.$cyl) %>% map(~lm(mpg ~ wt, data = .)) Additionally, the period i was told can be used "to refer to the current list element" .