Skip to content

Commit a668333

Browse files
committed
remove aggregations with no or censored output
1 parent 3023adb commit a668333

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

facebook/delphiFacebook/R/contingency_aggregate.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ produce_aggregates <- function(df, aggregations, cw_list, params) {
7878
keep_vars <- c("val", "se", "sample_size", "represented")
7979

8080
for (agg_id in names(dfs_out)) {
81+
if (nrow(dfs_out[[agg_id]]) == 0) {
82+
dfs_out[[agg_id]] <- NULL
83+
next
84+
}
8185
agg_metric <- aggregations$name[aggregations$id == agg_id]
8286
map_old_new_names <- keep_vars
8387
names(map_old_new_names) <- paste(keep_vars, agg_metric, sep="_")

0 commit comments

Comments
 (0)