Skip to content

Commit

Permalink
show data.table result after using ':='
Browse files Browse the repository at this point in the history
  • Loading branch information
bblodfon committed Oct 17, 2024
1 parent 1eef6c6 commit f2ccbda
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/voting_methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,5 @@ seq_phragmen_rule = function(voters, candidates, weights, committee_size = NULL)
add_borda_score = function(dt, n = NULL) {
if (is.null(n)) n = nrow(dt)
borda_score = NULL # silence data.table note: "no visible global binding"
dt[, borda_score := if (nrow(dt) == 1) 1 else (n - .I) / (n - 1)]
dt[, borda_score := if (nrow(dt) == 1) 1 else (n - .I) / (n - 1)][]
}

0 comments on commit f2ccbda

Please sign in to comment.