diff --git a/.github/workflows/r.yml b/.github/workflows/r.yml index 5494192..480c1a1 100644 --- a/.github/workflows/r.yml +++ b/.github/workflows/r.yml @@ -110,7 +110,8 @@ jobs: pipe_continuation_linter, semicolon_terminator_linter, single_quotes_linter, spaces_inside_linter, trailing_blank_lines_linter, trailing_whitespace_linter, - undesirable_function_linter, undesirable_operator_linter + undesirable_function_linter, undesirable_operator_linter, + unneeded_concatenation_linter ) # TODO: expand style rules as package matures lint_package(linters = style_rules) shell: Rscript {0} diff --git a/R/globals.R b/R/globals.R index 300a358..0e340cb 100644 --- a/R/globals.R +++ b/R/globals.R @@ -1,7 +1,7 @@ COUNTS <- array(0, dim = c(100, 100, 100)) SUMCOUNTS <- array(0, dim = c(100, 100)) -PARTITION <- array(1, dim = c(100)) -POP_LOGML <- array(1, dim = c(100)) +PARTITION <- array(1, dim = 100) +POP_LOGML <- array(1, dim = 100) LOGDIFF <- array(1, dim = c(100, 100)) # If handling globas break, try other ideas from https://stackoverflow.com/a/65252740/1169233 diff --git a/R/indMix.R b/R/indMix.R index 5cc9811..922b764 100644 --- a/R/indMix.R +++ b/R/indMix.R @@ -516,7 +516,7 @@ indMix <- function(c, npops, dispText = TRUE) { if (ready == 0) { if (vaihe == 1) { - roundTypes <- c(1) + roundTypes <- 1 } else if (vaihe == 2) { roundTypes <- c(2, 1) } else if (vaihe == 3) { diff --git a/R/writeMixtureInfo.R b/R/writeMixtureInfo.R index d04cb19..44a7e9f 100644 --- a/R/writeMixtureInfo.R +++ b/R/writeMixtureInfo.R @@ -185,7 +185,7 @@ writeMixtureInfo <- function(logml, rowsFromInd, data, adjprior, priorTerm, outP if (fid != -1) { append(fid, " ") append(fid, " ") - append(fid, c("KL-divergence matrix in PHYLIP format:")) + append(fid, "KL-divergence matrix in PHYLIP format:") append(fid, "\n") } @@ -290,7 +290,7 @@ writeMixtureInfo <- function(logml, rowsFromInd, data, adjprior, priorTerm, outP append(fid, "\n") append(fid, " ") append(fid, "\n") - append(fid, c("Probabilities for number of clusters")) + append(fid, "Probabilities for number of clusters") append(fid, "\n") } diff --git a/tests/testthat/test-convertedBaseFunctions.R b/tests/testthat/test-convertedBaseFunctions.R index b5c51af..d2a0a44 100644 --- a/tests/testthat/test-convertedBaseFunctions.R +++ b/tests/testthat/test-convertedBaseFunctions.R @@ -139,7 +139,7 @@ test_that("isempty works as expected", { B <- matrix(rep(NA, 4), 2) C <- matrix(rep(0, 4), 2) cat1 <- as.factor(c(NA, NA)) - cat2 <- as.factor(c()) + cat2 <- factor() str1 <- matrix(rep("", 3)) expect_true(isempty(A)) expect_false(isempty(B))