Skip to content

Commit 0301b6b

Browse files
committed
more fix tests and warnings
1 parent 29137c4 commit 0301b6b

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

R/methods-MSnExp.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ setMethod("combineSpectra", "MSnExp", function(object, fcol = "fileIdx",
588588
BPPARAM <- getBpParam(object, BPPARAM = BPPARAM)
589589
fns <- fileNames(object)
590590
if (is(object, "MSnExp") && fcol == "fileIdx")
591-
fData(object)$fileIdx <- fromFile(object)
591+
fData(object)[, "fileIdx"] <- fromFile(object)
592592
objs <- split(object, fromFile(object))
593593
dots <- list(...)
594594
res <- bplapply(objs, function(z, fcol, fns, dots) {

R/utils.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ nologging <- function(object, n = 1) {
587587
## removes the last n entries from
588588
## object@processingData@processing
589589
l <- length(object@processingData@processing)
590-
x <- seq(l, length = n, by = -1)
590+
x <- seq(l, length.out = n, by = -1)
591591
object@processingData@processing <-
592592
object@processingData@processing[-x]
593593
stopifnot(length(object@processingData@processing) == (l - n))

tests/testthat/test_nadata.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ test_that("makeNAdata", {
3434
test_that("makeNAdata2", {
3535
expect_error(makeNaData2(1))
3636
expect_error(makeNaData2(dunkley2006))
37-
expect_error(makeNaData2(dunkley2006, nRows = 1:10, nNA = 1:2))
37+
expect_error(makeNaData2(dunkley2006, nRows = 1:10, nNAs = 1:2))
3838

3939

4040
tmp <- makeNaData2(dunkley2006[1:56],
41-
nRows = 1:10, nNA = 1:10,
41+
nRows = 1:10, nNAs = 1:10,
4242
exclude = 1)
4343
expect_true(!anyNA(tmp[1, ]))
4444
expect_true(all(apply(exprs(tmp[-1, ]), 1, function(x) any(is.na(x)))))
@@ -48,7 +48,7 @@ test_that("makeNAdata2", {
4848
k <- logical(56)
4949
k[1] <- TRUE
5050
tmp <- makeNaData2(dunkley2006[1:56],
51-
nRows = 1:10, nNA = 1:10,
51+
nRows = 1:10, nNAs = 1:10,
5252
exclude = k)
5353
expect_true(!anyNA(tmp[1, ]))
5454
expect_true(all(apply(exprs(tmp[-1, ]), 1, function(x) any(is.na(x)))))
@@ -57,14 +57,14 @@ test_that("makeNAdata2", {
5757

5858
k <- featureNames(dunkley2006)[1]
5959
tmp <- makeNaData2(dunkley2006[1:56],
60-
nRows = 1:10, nNA = 1:10,
60+
nRows = 1:10, nNAs = 1:10,
6161
exclude = k)
6262
expect_true(!anyNA(tmp[1, ]))
6363
expect_true(all(apply(exprs(tmp[-1, ]), 1, function(x) any(is.na(x)))))
6464
nna <- table(apply(exprs(tmp[-1, ]), 1, function(x) sum(is.na(x))))
6565
expect_identical(as.vector(nna), 1:10)
6666

67-
tmp <- makeNaData2(dunkley2006, nRows = 1:10, nNA = 1:10)
67+
tmp <- makeNaData2(dunkley2006, nRows = 1:10, nNAs = 1:10)
6868
expect_identical(sum(is.na(exprs(tmp))), sum(1:10 * 1:10))
6969
})
7070

0 commit comments

Comments
 (0)