Skip to content

Commit 9e9b57a

Browse files
committed
refactor: use more seq_along(x) instead of 1:length(x)
1 parent e33300e commit 9e9b57a

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

tests/factorize_test_irregular.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ x_plot <- list(x, x, fx[[3]])
9393
cols <- c("cornflowerblue", "darkseagreen", "darkred")
9494
opar <- par(mfrow = c(3,2))
9595
wch <- c(1,2,10)
96-
for(w in 1:length(wch)) {
96+
for(w in seq_along(wch)) {
9797
plot.mboost(fac$resp, which = wch[w], col = "darkgrey", ask = FALSE,
9898
main = names(fac$resp$baselearner[wch[w]]))
9999
lines(sort(t), ft[[w]][order(t)]*max(d), col = cols[w], lty = 2)
@@ -158,7 +158,7 @@ ratio <- -max(abs(predict(fac$resp, which = 1))) / max(abs(predict(fac2$resp, wh
158158

159159
opar <- par(mfrow = c(3,2))
160160
wch <- c(1,2,10)
161-
for(w in 1:length(wch)) {
161+
for(w in seq_along(wch)) {
162162
plot.mboost(fac$resp, which = wch[w], col = "darkgrey", ask = FALSE,
163163
main = names(fac$resp$baselearner[wch[w]]))
164164

tests/factorize_test_regular.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ x_plot <- list(x, x, fx[[3]])
7676
cols <- c("cornflowerblue", "darkseagreen", "darkred")
7777
opar <- par(mfrow = c(3,2))
7878
wch <- c(1,2,10)
79-
for(w in 1:length(wch)) {
79+
for(w in seq_along(wch)) {
8080
plot.mboost(fac$resp, which = wch[w], col = "darkgrey", ask = FALSE,
8181
main = names(fac$resp$baselearner[wch[w]]))
8282
lines(t, ft[[w]]*max(d), col = cols[w], lty = 2)

0 commit comments

Comments
 (0)