I'm sorry if this is a repeat but I can't find it:
I'm trying to use the . placeholder with the pipe (%>%) from magrittr, and it seems not to work when it's the second call.
For instance, this works:
data.frame(t = c(1.1,2.2,3.3), y = c(1,2,3)) %$% (t-y)^2 %>% sum(.)
But this doesn't:
data.frame(t = c(1.1,2.2,3.3), y = c(1,2,3)) %$% (t-y)^2 %>% sum(.)/length(.)
Any intuition for why this is happening? Thanks!
Danny