Skip to content

Commit

Permalink
style + lint
Browse files Browse the repository at this point in the history
  • Loading branch information
martinju committed Oct 22, 2024
1 parent 776e352 commit 253a0fd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
1 change: 0 additions & 1 deletion R/cli.R
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ cli_startup <- function(internal, model_class, verbose) {
#' @export
#' @keywords internal
cli_compute_vS <- function(internal) {

verbose <- internal$parameters$verbose
approach <- internal$parameters$approach

Expand Down
12 changes: 5 additions & 7 deletions R/compute_vS.R
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ compute_MCint <- function(dt, pred_cols = "p_hat") {
#' @export
#' @keywords internal
append_vS_list <- function(vS_list, internal) {

iter <- length(internal$iter_list)

# Adds v_S output above to any vS_list already computed
Expand All @@ -243,17 +242,17 @@ append_vS_list <- function(vS_list, internal) {

# Creates a mapper from the last id_coalition to the new id_coalition numbering
id_coalitions_mapper <- merge(prev_coalition_map,
current_coalition_map,
by = "coalitions_str",
suffixes = c("", "_new")
current_coalition_map,
by = "coalitions_str",
suffixes = c("", "_new")
)
prev_vS_list_new <- list()

# Applies the mapper to update the prev_vS_list ot the new id_coalition numbering
for (k in seq_along(prev_vS_list)) {
prev_vS_list_new[[k]] <- merge(prev_vS_list[[k]],
id_coalitions_mapper[, .(id_coalition, id_coalition_new)],
by = "id_coalition"
id_coalitions_mapper[, .(id_coalition, id_coalition_new)],
by = "id_coalition"
)
prev_vS_list_new[[k]][, id_coalition := id_coalition_new]
prev_vS_list_new[[k]][, id_coalition_new := NULL]
Expand All @@ -263,5 +262,4 @@ append_vS_list <- function(vS_list, internal) {
vS_list <- c(prev_vS_list_new, vS_list)
}
return(vS_list)

}

0 comments on commit 253a0fd

Please sign in to comment.