Closed dongzhuoer closed 5 years ago
date
and wday
are both function name, so I understand that using .$
can reduce ambiguity.
But there is another problem, x %>% f(g(.))
means x %>% f(., g(.))
From ?`%>%`
iris %>% subset(1:nrow(.) %% 2 == 0)
is equivalent to iris %>% subset(., 1:nrow(.) %% 2 == 0)
So every time I use .
in nested function, I would add {}
to create a lambda expression.
what about .data$
since they are all inside dplyr::mutate()
I checked the book, it neither introduces .$
not .data$
.
We may need to add a paragraph explaining why we use .data$
.
At one point .$
was required to get case_when()
to work within mutate()
. This was before tidyeval standardized everything. I'll need to check what will work now.
Fixed in 159facabaafc697b2
I think that the biggest drawback for dplyr is using system function name as variable name.
For example,
would cause great trouble for
dplyr::mutate()
and so on.