Skip to content

Commit 9a4a601

Browse files
committed
In filter.epi_archive, favor avoiding incorrect geo_type reinferences
1 parent 8546548 commit 9a4a601

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

R/methods-epi_archive.R

+5-10
Original file line numberDiff line numberDiff line change
@@ -1070,16 +1070,11 @@ filter.epi_archive <- function(.data, ..., .by = NULL, .format_aware = FALSE) {
10701070
.by = .by
10711071
)
10721072
}
1073-
out_geo_type <-
1074-
if (.data$geo_type == "custom") {
1075-
# We might be going from a multi-resolution to single-resolution archive;
1076-
# e.g. national+state -> state; try to re-infer:
1077-
guess_geo_type(out_tbl$geo_value)
1078-
} else {
1079-
# We risk less-understandable inference failures such as inferring "hhs"
1080-
# from selecting hrr 10 data; just use the old geo_type:
1081-
.data$geo_type
1082-
}
1073+
# We could try to re-infer the geo_type, e.g., when filtering from
1074+
# national+state to just state. However, we risk inference failures such as
1075+
# "hrr" -> "hhs" from filtering to hrr 10, or "custom" -> USA-related when
1076+
# working with non-USA data:
1077+
out_geo_type <- .data$geo_type
10831078
# We might be going from daily to weekly; re-infer:
10841079
out_time_type <- guess_time_type(out_tbl$time_value)
10851080
# Even if they narrow down to just a single value of an other_keys column,

0 commit comments

Comments
 (0)