У меня есть этот набор данных, и я хочу вычислить ежедневный темп роста из столбца cu_deaths на основе последних семи дней. Есть идеи? В dplyr
, если возможно:
dput:
structure(list(Country.Region = c("Greece", "Greece", "Greece",
"Greece", "Greece", "Greece", "Greece"), date = structure(c(1586577600,
1586664000, 1586750400, 1586836800, 1586923200, 1587009600, 1587096000
), class = c("POSIXct", "POSIXt"), tzone = ""), confirmed = c(70,
33, 31, 25, 22, 15, 17), death = c(1, 5, 1, 2, 1, 3, 3), recovered = c(0,
0, 0, 0, 0, 0, 0), cu_cases = c(2081, 2114, 2145, 2170, 2192,
2207, 2224), cu_deaths = c(93, 98, 99, 101, 102, 105, 108), days_elapsed = c(21,
22, 23, 24, 25, 26, 27), end_label = c(NA, NA, NA, NA, NA, NA,
"Greece"), index = c(1, 2, 3, 4, 5, 6, 7)), row.names = c(NA,
-7L), class = c("tbl_df", "tbl", "data.frame"))