azadag
9/27/2018 - 6:29 PM

dplyr row-qtq change caluation

in a summarize function take one row by another data[2] / data[1]

q <- dat %>%
  filter(Age %in% c(25,65)) %>%
  group_by( PopName, Year) %>%
  summarize( q2565 = 1- lx[2]/lx[1])