Skip to content

Commit

Permalink
1:nrow etc to seq_len, per goodpractices
Browse files Browse the repository at this point in the history
  • Loading branch information
dankelley committed May 12, 2018
1 parent 28aeaaa commit d4840d0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/misc.R
Original file line number Diff line number Diff line change
Expand Up @@ -1372,7 +1372,7 @@ plotTaylor <- function(x, y, scale, pch, col, labels, pos, ...)
text(-m, 0, "R=-1", pos=2)
par(xpd=xpdOld)
points(xSD, 0, pch=20, cex=1.5)
for (column in 1:ncol(y)) {
for (column in seq_len(ncol(y))) {
ySD <- sd(y[, column], na.rm=TRUE)
R <- cor(x, y[, column])^2
##cat("column=", column, "ySD=", ySD, "R=", R, "col=", col[column], "pch=", pch[column], "\n")
Expand Down Expand Up @@ -3207,9 +3207,9 @@ fillGap <- function(x, method=c("linear"), rule=1)
res <- do_fill_gap_1d(x, rule)
} else if (is.matrix(x)) {
res <- x
for (col in 1:ncol(x))
for (col in seq_len(ncol(x)))
res[, col] <- do_fill_gap_1d(x[, col], rule)
for (row in 1:nrow(x))
for (row in seq_len(nrow(x)))
res[row, ] <- do_fill_gap_1d(x[row, ], rule)
} else {
stop("only works if 'x' is a vector or a matrix")
Expand Down

0 comments on commit d4840d0

Please sign in to comment.