Running ‘testthat.R’ [4s/6s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library("testthat")
  > test_check("MALDIquantForeign")
  Loading required package: MALDIquantForeign
  Loading required package: MALDIquant
  
  This is MALDIquant version 1.17
  Quantitative Analysis of Mass Spectrometry Data
   See '?MALDIquant' for more information about this package.
  
  1. Error: exportMsd,list (@test_exportMsd-methods.R#53) ------------------------
  subscript out of bounds
  1: MALDIquantForeign::exportMsd(spectra, path = tmp, force = TRUE, peaks = peaks) at testthat/test_exportMsd-methods.R:53
  2: MALDIquantForeign::exportMsd(spectra, path = tmp, force = TRUE, peaks = peaks)
  3: .local(x, ...)
  4: export(x, path = path, type = "msd", force = force, peaks = peaks, ...)
  5: export(x, path = path, type = "msd", force = force, peaks = peaks, ...)
  6: .local(x, ...)
  7: do.call(.exportToDir, modifyList(list(x = x, path = path, type = type, force = force), 
         dots))
  8: (function (x, path, type, force = FALSE, ...) 
     {
         if (!file.exists(path) && force) {
             dir.create(path, showWarnings = FALSE, recursive = TRUE)
         }
         if (!file.exists(path)) {
             stop("Directory ", sQuote(path), " doesn't exist!")
         }
         if (!file.info(path)$isdir) {
             stop(sQuote(path), " is no directory!")
         }
         if (file.access(path, 2) != 0) {
             stop("No permissions to write into ", sQuote(path), "!")
         }
         i <- pmatch(tolower(type), exportFormats$type, nomatch = 0, duplicates.ok = FALSE)
         if (i) {
             filenames <- .composeFilename(x, fileExtension = exportFormats$extension[i])
             filenames <- file.path(path, filenames)
             optArgs <- list(...)
             peaks <- list()
             if (hasArg(peaks)) {
                 peaks <- optArgs$peaks
                 optArgs$peaks <- NULL
             }
             for (i in seq(along = x)) {
                 arguments <- list(x = x[[i]], file = filenames[i], type = type, force = force)
                 arguments <- modifyList(arguments, optArgs)
                 if (length(peaks)) {
                     arguments$peaks <- peaks[[i]]
                 }
                 do.call(export, arguments)
             }
         }
         else {
             stop("File type ", sQuote(type), " is not supported!")
         }
         invisible()
     })(x = list(new("MassSpectrum",
     mass = 1:5, intensity = 6:10, metaData = list(owner = "OWNER", 
         institution = "INSTITUTION", instrument = "INSTRUMENT")), new("MassSpectrum",
     
         mass = 1:5, intensity = 6:10, metaData = list(owner = "OWNER", institution = "INSTITUTION", 
             instrument = "INSTRUMENT"))), path = "/tmp/Rtmpw1Jpaj", type = "msd", force = TRUE, 
         peaks = list(new("MassPeaks",
     snr = 1:2, mass = 4:5, intensity = 9:10, metaData = list()), 
             new("MassPeaks",
     snr = 1:2, mass = 4:5, intensity = 9:10, metaData = list())))
  9: .composeFilename(x, fileExtension = exportFormats$extension[i])
  10: .composeFilename(x, fileExtension = exportFormats$extension[i])
  11: .local(x, ...)
  12: .uniqueBaseFilenames(filenames, fileExtension)
  13: .cutFilenames(.withoutFileExtension(x))
  
  testthat results ================================================================
  OK: 239 SKIPPED: 1 FAILED: 1
  1. Error: exportMsd,list (@test_exportMsd-methods.R#53) 
  
  Error: testthat unit tests failed
  Execution halted