Skip to content

Commit b275ab9

Browse files
committed
combine column and row filters
1 parent 43b7d25 commit b275ab9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

facebook/delphiFacebook/R/aggregate.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ summarize_indicators_day <- function(day_df, indicators, target_day, geo_level,
181181

182182
# Copy only columns we're using.
183183
select_cols <- c(metric, var_weight, "weight_in_location")
184-
ind_df <- sub_df[, select_cols, with=FALSE][!is.na(sub_df[[var_weight]]) & !is.na(sub_df[[metric]]), ]
184+
ind_df <- sub_df[!is.na(sub_df[[var_weight]]) & !is.na(sub_df[[metric]]), select_cols, with=FALSE]
185185

186186
if (nrow(ind_df) > 0)
187187
{

facebook/delphiFacebook/R/contingency_aggregate.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ summarize_aggregations_group <- function(group_df, aggregations, target_group, g
336336

337337
# Copy only columns we're using.
338338
select_cols <- c(metric, var_weight, "weight_in_location")
339-
agg_df <- group_df[, select_cols, with=FALSE][!is.na(eval(as.name(metric))), ]
339+
agg_df <- group_df[!is.na(eval(as.name(metric))), select_cols, with=FALSE]
340340

341341
if (nrow(agg_df) > 0) {
342342
s_mix_coef <- params$s_mix_coef

0 commit comments

Comments
 (0)