Skip to content

Commit

Permalink
use seq_along() to index objects in a for loop
Browse files Browse the repository at this point in the history
  • Loading branch information
cjyetman authored Aug 9, 2024
2 parents fc0736f + f5e4e2f commit 07755f7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion run_match_prioritize.R
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ if (apply_sector_split & sector_split_type_select == "equal_weights") {
}

# prioritize and save files----
for (i in 1:length(matched_lbk_manual)) {
for (i in seq_along(matched_lbk_manual)) {
group_name <- unique(matched_lbk_manual[[i]]$group_id)

## prioritize matched loan book----
Expand Down
2 changes: 1 addition & 1 deletion run_matching.R
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ raw_lbk <- readr::read_csv(
dplyr::group_split(.data$group_id)

# match and save loan books----
for (i in 1:length(raw_lbk)) {
for (i in seq_along(raw_lbk)) {
group_name <- unique(raw_lbk[[i]]$group_id)

## match data----
Expand Down

0 comments on commit 07755f7

Please sign in to comment.