diff --git a/R/ANOVA.R b/R/ANOVA.R index 21466583..bf5b0130 100644 --- a/R/ANOVA.R +++ b/R/ANOVA.R @@ -46,11 +46,9 @@ ANOVA <- R6Class( k <- length(splited) bar_.. <- mean(data) - bar_i. <- c( - lapply( - splited, function(x) rep_len(mean(x), length(x)) - ), recursive = TRUE, use.names = FALSE - ) + bar_i. <- unlist(lapply( + splited, function(x) rep.int(mean(x), length(x)) + ), recursive = FALSE, use.names = FALSE) mst <- sum((bar_i. - bar_..)^2) / (k - 1) mse <- sum((data - bar_i.)^2) / (N - k) diff --git a/R/Correlation.R b/R/Correlation.R index d75c46c2..488d46f8 100644 --- a/R/Correlation.R +++ b/R/Correlation.R @@ -53,7 +53,9 @@ Correlation <- R6Class( order_x <- order(x) x_reorder <- x[order_x] - i_index <- c(lapply(seq_len(n - 1), seq_len), recursive = TRUE) + i_index <- unlist(lapply( + seq_len(n - 1), seq_len + ), recursive = FALSE, use.names = FALSE) j_index <- rep.int(seq_len(n)[-1], seq_len(n - 1)) x_equal <- (x_reorder[i_index] == x_reorder[j_index]) diff --git a/R/JonckheereTerpstra.R b/R/JonckheereTerpstra.R index 69c0d4a6..dd9a1b35 100644 --- a/R/JonckheereTerpstra.R +++ b/R/JonckheereTerpstra.R @@ -34,16 +34,18 @@ JonckheereTerpstra <- R6Class( .define = function() { k <- as.integer(get_last(names(private$.data))) ij <- list( - i = c(lapply(seq_len(k - 1), seq_len), recursive = TRUE), + i = unlist(lapply( + seq_len(k - 1), seq_len + ), recursive = FALSE, use.names = FALSE), j = rep.int(seq_len(k)[-1], seq_len(k - 1)) ) private$.statistic_func <- function(data, group) { where <- split(seq_along(group), group) - sum(c(.mapply( + sum(unlist(.mapply( FUN = function(i, j) { outer(data[where[[i]]], data[where[[j]]], "<") }, dots = ij, MoreArgs = NULL - ), recursive = TRUE)) + ), recursive = FALSE, use.names = FALSE)) } }, diff --git a/R/KSampleTest.R b/R/KSampleTest.R index 0b0b42a1..2690beef 100644 --- a/R/KSampleTest.R +++ b/R/KSampleTest.R @@ -21,7 +21,7 @@ KSampleTest <- R6Class( data <- get_list(...) private$.raw_data <- setNames( - c(data, recursive = TRUE, use.names = FALSE), + unlist(data, recursive = FALSE, use.names = FALSE), rep.int(seq_along(data), vapply(data, length, integer(1))) ) }, diff --git a/R/KolmogorovSmirnov.R b/R/KolmogorovSmirnov.R index b9ae7c79..a791d44c 100644 --- a/R/KolmogorovSmirnov.R +++ b/R/KolmogorovSmirnov.R @@ -30,7 +30,7 @@ KolmogorovSmirnov <- R6Class( m <- length(private$.data$x) n <- length(private$.data$y) - tmp <- rep_len(1 / m, m + n) + tmp <- rep.int(1 / m, m + n) private$.statistic_func <- function(x, y) { max(abs(cumsum(`[<-`(tmp, order(c(x, y)) <= m, -1 / n)))) } diff --git a/R/MultipleComparison.R b/R/MultipleComparison.R index 09db2e5a..55960bb1 100644 --- a/R/MultipleComparison.R +++ b/R/MultipleComparison.R @@ -78,7 +78,9 @@ MultipleComparison <- R6Class( k <- as.integer(get_last(names(private$.raw_data))) private$.ij <- list( i = rep.int(seq_len(k - 1), seq.int(k - 1, 1)), - j = c(lapply(seq.int(2, k), seq.int, to = k), recursive = TRUE) + j = unlist(lapply( + seq.int(2, k), seq.int, to = k + ), recursive = FALSE, use.names = FALSE) ) }, diff --git a/R/TwoSamplePairedTest.R b/R/TwoSamplePairedTest.R index e35366f0..6ed1ed2d 100644 --- a/R/TwoSamplePairedTest.R +++ b/R/TwoSamplePairedTest.R @@ -27,7 +27,7 @@ TwoSamplePairedTest <- R6Class( .calculate_statistic = function() { private$.statistic <- private$.statistic_func( - swapped = rep_len(FALSE, nrow(private$.data)) + swapped = rep.int(FALSE, nrow(private$.data)) ) },