From c94a8ddb8b9cf823f0742232816c3b277db1a9f9 Mon Sep 17 00:00:00 2001 From: "Daniel J. McDonald" Date: Tue, 13 Aug 2024 10:56:50 -0700 Subject: [PATCH 01/14] reorder to match `new_epi_df()` constructor --- R/key_colnames.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/key_colnames.R b/R/key_colnames.R index 99d8a9ed..b0119764 100644 --- a/R/key_colnames.R +++ b/R/key_colnames.R @@ -18,20 +18,20 @@ key_colnames.default <- function(x, ...) { #' @export key_colnames.data.frame <- function(x, other_keys = character(0L), ...) { assert_character(other_keys) - nm <- c("time_value", "geo_value", other_keys) + nm <- c("geo_value", "time_value", other_keys) intersect(nm, colnames(x)) } #' @export key_colnames.epi_df <- function(x, ...) { other_keys <- attr(x, "metadata")$other_keys - c("time_value", "geo_value", other_keys) + c("geo_value", "time_value", other_keys) } #' @export key_colnames.epi_archive <- function(x, ...) { other_keys <- attr(x, "metadata")$other_keys - c("time_value", "geo_value", other_keys) + c("geo_value", "time_value", other_keys) } kill_time_value <- function(v) { From 896a3816ce8cb7401d2b4610fc9f3b570b2b4e52 Mon Sep 17 00:00:00 2001 From: "Daniel J. McDonald" Date: Tue, 13 Aug 2024 11:12:17 -0700 Subject: [PATCH 02/14] fix TZ warnings --- tests/testthat/test-utils.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/testthat/test-utils.R b/tests/testthat/test-utils.R index e220af16..17a8c190 100644 --- a/tests/testthat/test-utils.R +++ b/tests/testthat/test-utils.R @@ -251,8 +251,8 @@ test_that("guess_period works", { weekly_posixcts ) # On POSIXlts: - daily_posixlts <- as.POSIXlt(daily_dates, tz = "ET") + 3600 - weekly_posixlts <- as.POSIXlt(weekly_dates, tz = "ET") + 3600 + daily_posixlts <- as.POSIXlt(daily_dates, tz = "UTC") + 3600 + weekly_posixlts <- as.POSIXlt(weekly_dates, tz = "UTC") + 3600 expect_identical( daily_posixlts[[1L]] + guess_period(daily_posixlts) * (seq_along(daily_posixlts) - 1L), daily_posixlts From 4151828cab818733487e9effd4a595161f3f884e Mon Sep 17 00:00:00 2001 From: "Daniel J. McDonald" Date: Tue, 13 Aug 2024 11:12:55 -0700 Subject: [PATCH 03/14] add internal method to arrange epi_df in canonical order (mostly useful for tests) --- NAMESPACE | 3 +++ R/methods-epi_df.R | 23 +++++++++++++++++++++++ tests/testthat/test-arrange-canonical.R | 19 +++++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 tests/testthat/test-arrange-canonical.R diff --git a/NAMESPACE b/NAMESPACE index 5a73629b..254ef68a 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -2,6 +2,8 @@ S3method("[",epi_df) S3method("names<-",epi_df) +S3method(arrange_canonical,default) +S3method(arrange_canonical,epi_df) S3method(as_epi_df,data.frame) S3method(as_epi_df,epi_df) S3method(as_epi_df,tbl_df) @@ -45,6 +47,7 @@ S3method(unnest,epi_df) export("%>%") export(archive_cases_dv_subset) export(arrange) +export(arrange_canonical) export(as_epi_archive) export(as_epi_df) export(as_tsibble) diff --git a/R/methods-epi_df.R b/R/methods-epi_df.R index faa2bdb0..94ea3040 100644 --- a/R/methods-epi_df.R +++ b/R/methods-epi_df.R @@ -331,3 +331,26 @@ reclass <- function(x, metadata) { attributes(x)$metadata <- metadata return(x) } + +#' @keywords internal +#' @export +arrange_canonical <- function(x, ...) { + UseMethod("arrange_canonical") +} + +#' @export +arrange_canonical.default <- function(x, ...) { + cli::cli_warn(c( + "`arrange_canonical()` is only meaningful for an {.cls epi_df}.", + i = "Returning the original {.cls {class(x)[1]}} object." + )) + return(x) +} + +#' @export +arrange_canonical.epi_df <- function(x, ...) { + keys <- key_colnames(x) + x %>% + dplyr::relocate(dplyr::all_of(keys), .before = 1) %>% + dplyr::arrange(dplyr::across(dplyr::all_of(keys))) +} diff --git a/tests/testthat/test-arrange-canonical.R b/tests/testthat/test-arrange-canonical.R new file mode 100644 index 00000000..5c3937cb --- /dev/null +++ b/tests/testthat/test-arrange-canonical.R @@ -0,0 +1,19 @@ +test_that("canonical arrangement works", { + tib <- tibble( + x = 1:8, + y = rep(c("b", "b", "a", "a"), times = 2), + geo_value = rep(c("ga", "ca"), each = 4), + time_value = rep(2:1, times = 4) + ) + expect_warning(arrange_canonical(tib)) + + tib <- tib %>% as_epi_df(additional_metadata = list(other_keys = "y")) + expect_equal(names(tib), c("geo_value", "time_value", "x", "y")) + + tib_sorted <- arrange_canonical(tib) + expect_equal(names(tib_sorted), c("geo_value", "time_value", "y", "x")) + expect_equal(tib_sorted$geo_value, rep(c("ca", "ga"), each = 4)) + expect_equal(tib_sorted$time_value, c(1, 1, 2, 2, 1, 1, 2, 2)) + expect_equal(tib_sorted$y, rep(letters[1:2], times = 4)) + expect_equal(tib_sorted$x, c(8, 6, 7, 5, 4, 2, 3, 1)) +}) From 0763e990d1858b0dc19fe6db1b995fe25bf2664f Mon Sep 17 00:00:00 2001 From: "Daniel J. McDonald" Date: Tue, 13 Aug 2024 11:20:47 -0700 Subject: [PATCH 04/14] styler --- tests/testthat/test-arrange-canonical.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/testthat/test-arrange-canonical.R b/tests/testthat/test-arrange-canonical.R index 5c3937cb..da0b249b 100644 --- a/tests/testthat/test-arrange-canonical.R +++ b/tests/testthat/test-arrange-canonical.R @@ -4,12 +4,12 @@ test_that("canonical arrangement works", { y = rep(c("b", "b", "a", "a"), times = 2), geo_value = rep(c("ga", "ca"), each = 4), time_value = rep(2:1, times = 4) - ) + ) expect_warning(arrange_canonical(tib)) - + tib <- tib %>% as_epi_df(additional_metadata = list(other_keys = "y")) expect_equal(names(tib), c("geo_value", "time_value", "x", "y")) - + tib_sorted <- arrange_canonical(tib) expect_equal(names(tib_sorted), c("geo_value", "time_value", "y", "x")) expect_equal(tib_sorted$geo_value, rep(c("ca", "ga"), each = 4)) From 65569918476a70f2e3bc655d00da16d83562191a Mon Sep 17 00:00:00 2001 From: "Daniel J. McDonald" Date: Tue, 13 Aug 2024 11:21:12 -0700 Subject: [PATCH 05/14] fix R CMD Check "long example lines" Note --- R/methods-epi_df.R | 12 ++++++++++-- man/complete.epi_df.Rd | 11 +++++++++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/R/methods-epi_df.R b/R/methods-epi_df.R index 94ea3040..9a268619 100644 --- a/R/methods-epi_df.R +++ b/R/methods-epi_df.R @@ -303,11 +303,18 @@ group_modify.epi_df <- function(.data, .f, ..., .keep = FALSE) { #' ) %>% #' as_epi_df(as_of = start_date + 3) #' weekly_edf %>% -#' complete(geo_value, time_value = full_seq(time_value, period = 7), fill = list(value = 0)) +#' complete( +#' geo_value, +#' time_value = full_seq(time_value, period = 7), +#' fill = list(value = 0) +#' ) #' # With grouping #' weekly_edf %>% #' group_by(geo_value) %>% -#' complete(time_value = full_seq(time_value, period = 7), fill = list(value = 0)) +#' complete( +#' time_value = full_seq(time_value, period = 7), +#' fill = list(value = 0) +#' ) #' @export complete.epi_df <- function(data, ..., fill = list(), explicit = TRUE) { result <- dplyr::dplyr_reconstruct(NextMethod(), data) @@ -333,6 +340,7 @@ reclass <- function(x, metadata) { } #' @keywords internal +#' @noRd #' @export arrange_canonical <- function(x, ...) { UseMethod("arrange_canonical") diff --git a/man/complete.epi_df.Rd b/man/complete.epi_df.Rd index d9ae9f4d..3a1d1825 100644 --- a/man/complete.epi_df.Rd +++ b/man/complete.epi_df.Rd @@ -68,9 +68,16 @@ weekly_edf <- tibble::tribble( ) \%>\% as_epi_df(as_of = start_date + 3) weekly_edf \%>\% - complete(geo_value, time_value = full_seq(time_value, period = 7), fill = list(value = 0)) + complete( + geo_value, + time_value = full_seq(time_value, period = 7), + fill = list(value = 0) + ) # With grouping weekly_edf \%>\% group_by(geo_value) \%>\% - complete(time_value = full_seq(time_value, period = 7), fill = list(value = 0)) + complete( + time_value = full_seq(time_value, period = 7), + fill = list(value = 0) + ) } From c3665e6fed80c5a2a124ad02a3618e6281cc4208 Mon Sep 17 00:00:00 2001 From: "Daniel J. McDonald" Date: Tue, 13 Aug 2024 11:54:58 -0700 Subject: [PATCH 06/14] pass all local checks --- R/methods-epi_df.R | 16 +++++++++++++--- man/arrange_canonical.Rd | 19 +++++++++++++++++++ man/complete.epi_df.Rd | 4 ++-- 3 files changed, 34 insertions(+), 5 deletions(-) create mode 100644 man/arrange_canonical.Rd diff --git a/R/methods-epi_df.R b/R/methods-epi_df.R index 9a268619..3ef144e3 100644 --- a/R/methods-epi_df.R +++ b/R/methods-epi_df.R @@ -274,8 +274,8 @@ group_modify.epi_df <- function(.data, .f, ..., .keep = FALSE) { #' daily_edf %>% #' group_by(geo_value) %>% #' complete(time_value = full_seq(time_value, period = 1)) -#' # Complete has explicit=TRUE by default, but if it's FALSE, then complete only fills the implicit gaps -#' # not those that are explicitly NA +#' # Complete has explicit=TRUE by default, but if it's FALSE, then complete +#' # only fills the implicit gaps, not those that are explicitly NA #' daily_edf <- tibble::tribble( #' ~geo_value, ~time_value, ~value, #' 1, start_date + 1, 1, @@ -339,8 +339,16 @@ reclass <- function(x, metadata) { return(x) } +#' Arrange an epi_df into a standard order +#' +#' Moves `key_colnames()` to the left, then arranges rows based on that +#' ordering. This function is mainly for use in tests and so that +#' other function output will be in predictable order, where necessary. +#' +#' @param x an `epi_df`. Other objects will produce a warning and return as is. +#' @param ... not used +#' #' @keywords internal -#' @noRd #' @export arrange_canonical <- function(x, ...) { UseMethod("arrange_canonical") @@ -348,6 +356,7 @@ arrange_canonical <- function(x, ...) { #' @export arrange_canonical.default <- function(x, ...) { + rlang::check_dots_empty() cli::cli_warn(c( "`arrange_canonical()` is only meaningful for an {.cls epi_df}.", i = "Returning the original {.cls {class(x)[1]}} object." @@ -357,6 +366,7 @@ arrange_canonical.default <- function(x, ...) { #' @export arrange_canonical.epi_df <- function(x, ...) { + rlang::check_dots_empty() keys <- key_colnames(x) x %>% dplyr::relocate(dplyr::all_of(keys), .before = 1) %>% diff --git a/man/arrange_canonical.Rd b/man/arrange_canonical.Rd new file mode 100644 index 00000000..07949fb2 --- /dev/null +++ b/man/arrange_canonical.Rd @@ -0,0 +1,19 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/methods-epi_df.R +\name{arrange_canonical} +\alias{arrange_canonical} +\title{Arrange an epi_df into a standard order} +\usage{ +arrange_canonical(x, ...) +} +\arguments{ +\item{x}{an \code{epi_df}. Other objects will produce a warning and return as is.} + +\item{...}{not used} +} +\description{ +Moves \code{key_colnames()} to the left, then arranges rows based on that +ordering. This function is mainly for use in tests and so that +other function output will be in predictable order, where necessary. +} +\keyword{internal} diff --git a/man/complete.epi_df.Rd b/man/complete.epi_df.Rd index 3a1d1825..9f450cb0 100644 --- a/man/complete.epi_df.Rd +++ b/man/complete.epi_df.Rd @@ -39,8 +39,8 @@ daily_edf \%>\% daily_edf \%>\% group_by(geo_value) \%>\% complete(time_value = full_seq(time_value, period = 1)) -# Complete has explicit=TRUE by default, but if it's FALSE, then complete only fills the implicit gaps -# not those that are explicitly NA +# Complete has explicit=TRUE by default, but if it's FALSE, then complete +# only fills the implicit gaps, not those that are explicitly NA daily_edf <- tibble::tribble( ~geo_value, ~time_value, ~value, 1, start_date + 1, 1, From 8fb30c91a1eefa23a60c6f49d8506cfae663d02a Mon Sep 17 00:00:00 2001 From: "Daniel J. McDonald" Date: Tue, 13 Aug 2024 11:56:36 -0700 Subject: [PATCH 07/14] bump version --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index d4adb8d3..07b0c4f1 100755 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: epiprocess Title: Tools for basic signal processing in epidemiology -Version: 0.8.2 +Version: 0.8.3 Authors@R: c( person("Jacob", "Bien", role = "ctb"), person("Logan", "Brooks", email = "lcbrooks@andrew.cmu.edu", role = c("aut", "cre")), From ec43cefcb98374ad114d5855642e983a6a280987 Mon Sep 17 00:00:00 2001 From: dajmcdon Date: Tue, 13 Aug 2024 18:57:12 +0000 Subject: [PATCH 08/14] style: styler (GHA) --- R/methods-epi_df.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/methods-epi_df.R b/R/methods-epi_df.R index 3ef144e3..4a2c06e2 100644 --- a/R/methods-epi_df.R +++ b/R/methods-epi_df.R @@ -340,11 +340,11 @@ reclass <- function(x, metadata) { } #' Arrange an epi_df into a standard order -#' +#' #' Moves `key_colnames()` to the left, then arranges rows based on that -#' ordering. This function is mainly for use in tests and so that +#' ordering. This function is mainly for use in tests and so that #' other function output will be in predictable order, where necessary. -#' +#' #' @param x an `epi_df`. Other objects will produce a warning and return as is. #' @param ... not used #' From 2bf591ab95fec200a526f17eef6bd347c75c5d4f Mon Sep 17 00:00:00 2001 From: "Logan C. Brooks" Date: Wed, 14 Aug 2024 17:25:23 -0700 Subject: [PATCH 09/14] Use an actually-valid `tz` instead of `"ET"` in tests --- tests/testthat/test-utils.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/testthat/test-utils.R b/tests/testthat/test-utils.R index 17a8c190..d18f9f48 100644 --- a/tests/testthat/test-utils.R +++ b/tests/testthat/test-utils.R @@ -240,8 +240,8 @@ test_that("guess_period works", { weekly_dates ) # On POSIXcts: - daily_posixcts <- as.POSIXct(daily_dates, tz = "ET") + 3600 - weekly_posixcts <- as.POSIXct(weekly_dates, tz = "ET") + 3600 + daily_posixcts <- as.POSIXct(daily_dates, tz = "US/Aleutian") + 3600 + weekly_posixcts <- as.POSIXct(weekly_dates, tz = "US/Aleutian") + 3600 expect_identical( daily_posixcts[[1L]] + guess_period(daily_posixcts) * (seq_along(daily_posixcts) - 1L), daily_posixcts From ac62ddb0e4308fce36fe0dd17fc289f479cb32fa Mon Sep 17 00:00:00 2001 From: "Daniel J. McDonald" Date: Thu, 15 Aug 2024 10:46:38 -0700 Subject: [PATCH 10/14] respond to review --- R/methods-epi_df.R | 7 +++---- man/arrange_canonical.Rd | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/R/methods-epi_df.R b/R/methods-epi_df.R index 4a2c06e2..b405cfff 100644 --- a/R/methods-epi_df.R +++ b/R/methods-epi_df.R @@ -341,7 +341,7 @@ reclass <- function(x, metadata) { #' Arrange an epi_df into a standard order #' -#' Moves `key_colnames()` to the left, then arranges rows based on that +#' Moves [key_colnames()] to the left, then arranges rows based on that #' ordering. This function is mainly for use in tests and so that #' other function output will be in predictable order, where necessary. #' @@ -357,9 +357,8 @@ arrange_canonical <- function(x, ...) { #' @export arrange_canonical.default <- function(x, ...) { rlang::check_dots_empty() - cli::cli_warn(c( - "`arrange_canonical()` is only meaningful for an {.cls epi_df}.", - i = "Returning the original {.cls {class(x)[1]}} object." + cli::cli_abort(c( + "`arrange_canonical()` is only meaningful for an {.cls epi_df}." )) return(x) } diff --git a/man/arrange_canonical.Rd b/man/arrange_canonical.Rd index 07949fb2..3d29c2af 100644 --- a/man/arrange_canonical.Rd +++ b/man/arrange_canonical.Rd @@ -12,7 +12,7 @@ arrange_canonical(x, ...) \item{...}{not used} } \description{ -Moves \code{key_colnames()} to the left, then arranges rows based on that +Moves \code{\link[=key_colnames]{key_colnames()}} to the left, then arranges rows based on that ordering. This function is mainly for use in tests and so that other function output will be in predictable order, where necessary. } From 7273781b2ee110d0d80b096c7c4bfea552d24775 Mon Sep 17 00:00:00 2001 From: Daniel McDonald Date: Thu, 15 Aug 2024 10:47:30 -0700 Subject: [PATCH 11/14] Update tests/testthat/test-arrange-canonical.R resolve suggestions Co-authored-by: brookslogan --- tests/testthat/test-arrange-canonical.R | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/testthat/test-arrange-canonical.R b/tests/testthat/test-arrange-canonical.R index da0b249b..8a6d2b6f 100644 --- a/tests/testthat/test-arrange-canonical.R +++ b/tests/testthat/test-arrange-canonical.R @@ -1,19 +1,19 @@ test_that("canonical arrangement works", { tib <- tibble( x = 1:8, - y = rep(c("b", "b", "a", "a"), times = 2), + demo_grp = rep(c("b", "b", "a", "a"), times = 2), geo_value = rep(c("ga", "ca"), each = 4), time_value = rep(2:1, times = 4) ) expect_warning(arrange_canonical(tib)) - tib <- tib %>% as_epi_df(additional_metadata = list(other_keys = "y")) - expect_equal(names(tib), c("geo_value", "time_value", "x", "y")) + tib <- tib %>% as_epi_df(additional_metadata = list(other_keys = "demo_grp")) + expect_equal(names(tib), c("geo_value", "time_value", "x", "demo_grp")) tib_sorted <- arrange_canonical(tib) - expect_equal(names(tib_sorted), c("geo_value", "time_value", "y", "x")) + expect_equal(names(tib_sorted), c("geo_value", "time_value", "demo_grp", "x")) expect_equal(tib_sorted$geo_value, rep(c("ca", "ga"), each = 4)) expect_equal(tib_sorted$time_value, c(1, 1, 2, 2, 1, 1, 2, 2)) - expect_equal(tib_sorted$y, rep(letters[1:2], times = 4)) + expect_equal(tib_sorted$demo_grp, rep(letters[1:2], times = 4)) expect_equal(tib_sorted$x, c(8, 6, 7, 5, 4, 2, 3, 1)) }) From 46061fb8ef71fbb7382ab9218325925daca1a01b Mon Sep 17 00:00:00 2001 From: Daniel McDonald Date: Thu, 15 Aug 2024 10:48:51 -0700 Subject: [PATCH 12/14] Update tests/testthat/test-utils.R Co-authored-by: brookslogan --- tests/testthat/test-utils.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/testthat/test-utils.R b/tests/testthat/test-utils.R index d18f9f48..12e7a3f7 100644 --- a/tests/testthat/test-utils.R +++ b/tests/testthat/test-utils.R @@ -251,8 +251,8 @@ test_that("guess_period works", { weekly_posixcts ) # On POSIXlts: - daily_posixlts <- as.POSIXlt(daily_dates, tz = "UTC") + 3600 - weekly_posixlts <- as.POSIXlt(weekly_dates, tz = "UTC") + 3600 + daily_posixlts <- as.POSIXlt(daily_dates, tz = "US/Aleutian") + 3600 + weekly_posixlts <- as.POSIXlt(weekly_dates, tz = "US/Aleutian") + 3600 expect_identical( daily_posixlts[[1L]] + guess_period(daily_posixlts) * (seq_along(daily_posixlts) - 1L), daily_posixlts From 08ac0403c81eef47d7275986ad5159fab427420e Mon Sep 17 00:00:00 2001 From: "Daniel J. McDonald" Date: Thu, 15 Aug 2024 11:26:31 -0700 Subject: [PATCH 13/14] hard error in tests --- tests/testthat/test-arrange-canonical.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testthat/test-arrange-canonical.R b/tests/testthat/test-arrange-canonical.R index 8a6d2b6f..ec42feac 100644 --- a/tests/testthat/test-arrange-canonical.R +++ b/tests/testthat/test-arrange-canonical.R @@ -5,7 +5,7 @@ test_that("canonical arrangement works", { geo_value = rep(c("ga", "ca"), each = 4), time_value = rep(2:1, times = 4) ) - expect_warning(arrange_canonical(tib)) + expect_error(arrange_canonical(tib)) tib <- tib %>% as_epi_df(additional_metadata = list(other_keys = "demo_grp")) expect_equal(names(tib), c("geo_value", "time_value", "x", "demo_grp")) From 4c830ef0188e3581c8a0ee7864bae97631336061 Mon Sep 17 00:00:00 2001 From: dsweber2 Date: Thu, 15 Aug 2024 14:34:41 -0500 Subject: [PATCH 14/14] Column order change for versioning snapshot --- .../_snaps/revision-latency-functions.md | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/tests/testthat/_snaps/revision-latency-functions.md b/tests/testthat/_snaps/revision-latency-functions.md index 00ee8253..1ac21469 100644 --- a/tests/testthat/_snaps/revision-latency-functions.md +++ b/tests/testthat/_snaps/revision-latency-functions.md @@ -28,19 +28,19 @@ time_value geo_value n_revisions min_lag max_lag time_near_latest spread 1 2020-01-01 ak 4 2 days 19 days 19 days 101 - 2 2020-01-01 al 1 0 days 19 days 19 days 99 - 3 2020-01-02 ak 1 4 days 5 days 4 days 9 - 4 2020-01-02 al 0 0 days 0 days 0 days 0 - 5 2020-01-03 ak 0 3 days 3 days 3 days 0 + 2 2020-01-02 ak 1 4 days 5 days 4 days 9 + 3 2020-01-03 ak 0 3 days 3 days 3 days 0 + 4 2020-01-01 al 1 0 days 19 days 19 days 99 + 5 2020-01-02 al 0 0 days 0 days 0 days 0 6 2020-01-03 al 1 1 days 2 days 2 days 3 7 2020-01-04 al 0 1 days 1 days 1 days 0 rel_spread min_value max_value median_value 1 0.990 1 102 6 - 2 0.99 1 100 50.5 - 3 0.09 91 100 95.5 - 4 0 1 1 1 - 5 NaN 0 0 0 + 2 0.09 91 100 95.5 + 3 NaN 0 0 0 + 4 0.99 1 100 50.5 + 5 0 1 1 1 6 0.75 1 4 2.5 7 0 9 9 9 @@ -76,19 +76,19 @@ time_value geo_value n_revisions min_lag max_lag time_near_latest spread 1 2020-01-01 ak 6 2 days 19 days 19 days 101 - 2 2020-01-01 al 1 0 days 19 days 19 days 99 - 3 2020-01-02 ak 1 4 days 5 days 4 days 9 - 4 2020-01-02 al 0 0 days 0 days 0 days 0 - 5 2020-01-03 ak 0 3 days 3 days 3 days 0 + 2 2020-01-02 ak 1 4 days 5 days 4 days 9 + 3 2020-01-03 ak 0 3 days 3 days 3 days 0 + 4 2020-01-01 al 1 0 days 19 days 19 days 99 + 5 2020-01-02 al 0 0 days 0 days 0 days 0 6 2020-01-03 al 1 1 days 2 days 2 days 3 7 2020-01-04 al 1 0 days 1 days 1 days 0 rel_spread min_value max_value median_value 1 0.990 1 102 5.5 - 2 0.99 1 100 50.5 - 3 0.09 91 100 95.5 - 4 0 1 1 1 - 5 NaN 0 0 0 + 2 0.09 91 100 95.5 + 3 NaN 0 0 0 + 4 0.99 1 100 50.5 + 5 0 1 1 1 6 0.75 1 4 2.5 7 0 9 9 9