Running ‘testthat.R’ [10s/14s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(satellite)
  Loading required package: raster
  Loading required package: sp
  > 
  > 
  > ### functions to create test data sets -----
  > 
  > ### Utility functions to quickly create test data sets for various sensors
  > ### Florian Detsch, last modified on 2017-07-24
  > 
  > tst_obj <- function(type = c("LC08", "LC8", "LE07", "LE7", "LT05")) {
  +   if (type[1] == "LC08")
  +     tst_obj_lc08()
  +   else if (type[1] == "LC8")
  +     tst_obj_lc8()
  +   else if (type[1] == "LE07")
  +     tst_obj_le07()
  +   else if (type[1] == "LE7")
  +     tst_obj_le7()
  +   else if (type[1] == "LT05")
  +     tst_obj_lt05()
  +   else 
  +     stop("Sensor test data not available, yet.\n")
  + }
  > 
  > 
  > ### collection 1 level-1 -----
  > 
  > ## landsat 8
  > tst_obj_lc08 <- function() {
  +   path <- system.file("extdata", package = "satellite")
  +   files <- list.files(path, pattern = glob2rx("LC08*.TIF"), full.names = TRUE)
  +   satellite(files)
  + }
  > 
  > ## landsat 7
  > tst_obj_le07 <- function() {
  +   path <- system.file("extdata", package = "satellite")
  +   files <- list.files(path, pattern = glob2rx("LE07*.TIF"), full.names = TRUE)
  +   satellite(files)
  + }
  > 
  > ## landsat 5
  > tst_obj_lt05 <- function() {
  +   path <- system.file("testdata/LT05", package = "satellite")
  +   files <- list.files(path, pattern = glob2rx("LT05*.TIF"), full.names = TRUE)
  +   satellite(files)
  + }
  > 
  > 
  > ### precollection level-1 -----
  > 
  > ## landsat 8
  > tst_obj_lc8 <- function() {
  +   path <- system.file("testdata/LC8", package = "satellite")
  +   files <- list.files(path, pattern = glob2rx("LC8*.TIF"), full.names = TRUE)
  +   satellite(files)
  + }
  > 
  > ## landsat 7
  > tst_obj_le7 <- function() {
  +   path <- system.file("testdata/LE7", package = "satellite")
  +   files <- list.files(path, pattern = glob2rx("LE7*.TIF"), full.names = TRUE)
  +   satellite(files)
  + }
  > 
  > 
  > ### perform tests -----
  > 
  > test_check("satellite")
  ── 1. Error: calcAtmosCorr for RasterLayers works as expected (@test-calcAtmosCo
  Cannot create RasterLayer object from this file; perhaps you need to install rgdal first
  1: satellite(files) at testthat/test-calcAtmosCorr.R:8
  2: satellite(files)
  3: .local(x, ...)
  4: lapply(seq(nrow(meta)), function(y) {
         act_layer <- raster(as.character(meta$FILE)[y])
         names(act_layer) <- meta$BCDE[y]
         return(act_layer)
     })
  5: FUN(X[[i]], ...)
  6: raster(as.character(meta$FILE)[y])
  7: raster(as.character(meta$FILE)[y])
  8: .local(x, ...)
  9: .rasterObjectFromFile(x, band = band, objecttype = "RasterLayer", ...)
  10: stop("Cannot create RasterLayer object from this file; perhaps you need to install rgdal first")
  
  ── 2. Error: calcAtmosCorr processes all solar bands (@test-calcAtmosCorr.R#46) 
  Cannot create RasterLayer object from this file; perhaps you need to install rgdal first
  1: satellite(files) at testthat/test-calcAtmosCorr.R:46
  2: satellite(files)
  3: .local(x, ...)
  4: lapply(seq(nrow(meta)), function(y) {
         act_layer <- raster(as.character(meta$FILE)[y])
         names(act_layer) <- meta$BCDE[y]
         return(act_layer)
     })
  5: FUN(X[[i]], ...)
  6: raster(as.character(meta$FILE)[y])
  7: raster(as.character(meta$FILE)[y])
  8: .local(x, ...)
  9: .rasterObjectFromFile(x, band = band, objecttype = "RasterLayer", ...)
  10: stop("Cannot create RasterLayer object from this file; perhaps you need to install rgdal first")
  
  ── 3. Error: calcAtmosCorr for Satellite works as expected (@test-calcAtmosCorr.
  Cannot create RasterLayer object from this file; perhaps you need to install rgdal first
  1: satellite(files) at testthat/test-calcAtmosCorr.R:71
  2: satellite(files)
  3: .local(x, ...)
  4: lapply(seq(nrow(meta)), function(y) {
         act_layer <- raster(as.character(meta$FILE)[y])
         names(act_layer) <- meta$BCDE[y]
         return(act_layer)
     })
  5: FUN(X[[i]], ...)
  6: raster(as.character(meta$FILE)[y])
  7: raster(as.character(meta$FILE)[y])
  8: .local(x, ...)
  9: .rasterObjectFromFile(x, band = band, objecttype = "RasterLayer", ...)
  10: stop("Cannot create RasterLayer object from this file; perhaps you need to install rgdal first")
  
  ── 4. Error: calcDODN works as expected (@test-calcDODN.R#8)  ──────────────────
  Cannot create RasterLayer object from this file; perhaps you need to install rgdal first
  1: satellite(files) at testthat/test-calcDODN.R:8
  2: satellite(files)
  3: .local(x, ...)
  4: lapply(seq(nrow(meta)), function(y) {
         act_layer <- raster(as.character(meta$FILE)[y])
         names(act_layer) <- meta$BCDE[y]
         return(act_layer)
     })
  5: FUN(X[[i]], ...)
  6: raster(as.character(meta$FILE)[y])
  7: raster(as.character(meta$FILE)[y])
  8: .local(x, ...)
  9: .rasterObjectFromFile(x, band = band, objecttype = "RasterLayer", ...)
  10: stop("Cannot create RasterLayer object from this file; perhaps you need to install rgdal first")
  
  ── 5. Error: calcPathRadDOS for numeric works as expected (@test-calcPathRadDOS.
  Cannot create RasterLayer object from this file; perhaps you need to install rgdal first
  1: satellite(files) at testthat/test-calcPathRadDOS.R:9
  2: satellite(files)
  3: .local(x, ...)
  4: lapply(seq(nrow(meta)), function(y) {
         act_layer <- raster(as.character(meta$FILE)[y])
         names(act_layer) <- meta$BCDE[y]
         return(act_layer)
     })
  5: FUN(X[[i]], ...)
  6: raster(as.character(meta$FILE)[y])
  7: raster(as.character(meta$FILE)[y])
  8: .local(x, ...)
  9: .rasterObjectFromFile(x, band = band, objecttype = "RasterLayer", ...)
  10: stop("Cannot create RasterLayer object from this file; perhaps you need to install rgdal first")
  
  ── 6. Error: calcPathRadDOS for Satellite works as expected (@test-calcPathRadDO
  Cannot create RasterLayer object from this file; perhaps you need to install rgdal first
  1: satellite(files) at testthat/test-calcPathRadDOS.R:53
  2: satellite(files)
  3: .local(x, ...)
  4: lapply(seq(nrow(meta)), function(y) {
         act_layer <- raster(as.character(meta$FILE)[y])
         names(act_layer) <- meta$BCDE[y]
         return(act_layer)
     })
  5: FUN(X[[i]], ...)
  6: raster(as.character(meta$FILE)[y])
  7: raster(as.character(meta$FILE)[y])
  8: .local(x, ...)
  9: .rasterObjectFromFile(x, band = band, objecttype = "RasterLayer", ...)
  10: stop("Cannot create RasterLayer object from this file; perhaps you need to install rgdal first")
  
  ── 7. Error: calcTOAIrradModel for 'Satellite' objects works as expected (@test-
  Cannot create RasterLayer object from this file; perhaps you need to install rgdal first
  1: lapply(1:length(path), function(i) {
         sid <- ifelse(i == 1, "LC08", "LC8")
         files <- list.files(path[i], pattern = glob2rx(paste0(sid, "*.TIF")), full.names = TRUE)
         sat <- satellite(files)
         test <- calcTOAIrradModel(sat)
         expect_equal(as.character(getSatBID(test)[1]), "1")
         expect_equal(round(as.numeric(getSatESUN(test)[1]), 4), round(1888.4115033, 4))
         expect_equal(as.character(getSatBID(test)[2]), "2")
         expect_equal(round(as.numeric(getSatESUN(test)[2]), 4), round(1974.8429354, 4))
         expect_equal(as.character(getSatBID(test)[3]), "3")
         expect_equal(round(as.numeric(getSatESUN(test)[3]), 4), round(1851.7520559, 4))
         expect_equal(as.character(getSatBID(test)[11]), "11")
         expect_equal(round(as.numeric(getSatESUN(test)[11]), 4), round(0.1068904, 4))
     }) at testthat/test-calcTOAIrradModel.R:26
  2: FUN(X[[i]], ...)
  3: satellite(files) at testthat/test-calcTOAIrradModel.R:29
  4: satellite(files)
  5: .local(x, ...)
  6: lapply(seq(nrow(meta)), function(y) {
         act_layer <- raster(as.character(meta$FILE)[y])
         names(act_layer) <- meta$BCDE[y]
         return(act_layer)
     })
  7: FUN(X[[i]], ...)
  8: raster(as.character(meta$FILE)[y])
  9: raster(as.character(meta$FILE)[y])
  10: .local(x, ...)
  11: .rasterObjectFromFile(x, band = band, objecttype = "RasterLayer", ...)
  12: stop("Cannot create RasterLayer object from this file; perhaps you need to install rgdal first")
  
  ── 8. Error: calcTOAIrradRadRef for 'numeric' input works as expected (@test-cal
  Cannot create RasterLayer object from this file; perhaps you need to install rgdal first
  1: satellite(files) at testthat/test-calcTOAIrradRadRef.R:8
  2: satellite(files)
  3: .local(x, ...)
  4: lapply(seq(nrow(meta)), function(y) {
         act_layer <- raster(as.character(meta$FILE)[y])
         names(act_layer) <- meta$BCDE[y]
         return(act_layer)
     })
  5: FUN(X[[i]], ...)
  6: raster(as.character(meta$FILE)[y])
  7: raster(as.character(meta$FILE)[y])
  8: .local(x, ...)
  9: .rasterObjectFromFile(x, band = band, objecttype = "RasterLayer", ...)
  10: stop("Cannot create RasterLayer object from this file; perhaps you need to install rgdal first")
  
  ── 9. Error: calcTOAIrradRadRef for 'numeric' input (P1L1) works as expected (@t
  Cannot create RasterLayer object from this file; perhaps you need to install rgdal first
  1: satellite(files) at testthat/test-calcTOAIrradRadRef.R:22
  2: satellite(files)
  3: .local(x, ...)
  4: lapply(seq(nrow(meta)), function(y) {
         act_layer <- raster(as.character(meta$FILE)[y])
         names(act_layer) <- meta$BCDE[y]
         return(act_layer)
     })
  5: FUN(X[[i]], ...)
  6: raster(as.character(meta$FILE)[y])
  7: raster(as.character(meta$FILE)[y])
  8: .local(x, ...)
  9: .rasterObjectFromFile(x, band = band, objecttype = "RasterLayer", ...)
  10: stop("Cannot create RasterLayer object from this file; perhaps you need to install rgdal first")
  
  ── 10. Error: calcTOAIrradRadRef for 'Satellite' input works as expected (@test-
  Cannot create RasterLayer object from this file; perhaps you need to install rgdal first
  1: satellite(files) at testthat/test-calcTOAIrradRadRef.R:33
  2: satellite(files)
  3: .local(x, ...)
  4: lapply(seq(nrow(meta)), function(y) {
         act_layer <- raster(as.character(meta$FILE)[y])
         names(act_layer) <- meta$BCDE[y]
         return(act_layer)
     })
  5: FUN(X[[i]], ...)
  6: raster(as.character(meta$FILE)[y])
  7: raster(as.character(meta$FILE)[y])
  8: .local(x, ...)
  9: .rasterObjectFromFile(x, band = band, objecttype = "RasterLayer", ...)
  10: stop("Cannot create RasterLayer object from this file; perhaps you need to install rgdal first")
  
  ── 11. Error: calcTOAIrradRadRef for 'Satellite' input (P1L1) works as expected 
  Cannot create RasterLayer object from this file; perhaps you need to install rgdal first
  1: satellite(files) at testthat/test-calcTOAIrradRadRef.R:54
  2: satellite(files)
  3: .local(x, ...)
  4: lapply(seq(nrow(meta)), function(y) {
         act_layer <- raster(as.character(meta$FILE)[y])
         names(act_layer) <- meta$BCDE[y]
         return(act_layer)
     })
  5: FUN(X[[i]], ...)
  6: raster(as.character(meta$FILE)[y])
  7: raster(as.character(meta$FILE)[y])
  8: .local(x, ...)
  9: .rasterObjectFromFile(x, band = band, objecttype = "RasterLayer", ...)
  10: stop("Cannot create RasterLayer object from this file; perhaps you need to install rgdal first")
  
  ── 12. Error: calcTOAIrradTable for 'Satellite' input works as expected (@test-c
  Cannot create RasterLayer object from this file; perhaps you need to install rgdal first
  1: satellite(files) at testthat/test-calcTOAIrradTable.R:26
  2: satellite(files)
  3: .local(x, ...)
  4: lapply(seq(nrow(meta)), function(y) {
         act_layer <- raster(as.character(meta$FILE)[y])
         names(act_layer) <- meta$BCDE[y]
         return(act_layer)
     })
  5: FUN(X[[i]], ...)
  6: raster(as.character(meta$FILE)[y])
  7: raster(as.character(meta$FILE)[y])
  8: .local(x, ...)
  9: .rasterObjectFromFile(x, band = band, objecttype = "RasterLayer", ...)
  10: stop("Cannot create RasterLayer object from this file; perhaps you need to install rgdal first")
  
  ── 13. Error: (unknown) (@test-extend.R#5)  ────────────────────────────────────
  Cannot create RasterLayer object from this file; perhaps you need to install rgdal first
  1: satellite(files) at testthat/test-extend.R:5
  2: satellite(files)
  3: .local(x, ...)
  4: lapply(seq(nrow(meta)), function(y) {
         act_layer <- raster(as.character(meta$FILE)[y])
         names(act_layer) <- meta$BCDE[y]
         return(act_layer)
     })
  5: FUN(X[[i]], ...)
  6: raster(as.character(meta$FILE)[y])
  7: raster(as.character(meta$FILE)[y])
  8: .local(x, ...)
  9: .rasterObjectFromFile(x, band = band, objecttype = "RasterLayer", ...)
  10: stop("Cannot create RasterLayer object from this file; perhaps you need to install rgdal first")
  
  ── 14. Error: maskInvarFeatures works as expected (@test-maskInvarFeatures.R#9) 
  Cannot create RasterLayer object from this file; perhaps you need to install rgdal first
  1: satellite(files) at testthat/test-maskInvarFeatures.R:9
  2: satellite(files)
  3: .local(x, ...)
  4: lapply(seq(nrow(meta)), function(y) {
         act_layer <- raster(as.character(meta$FILE)[y])
         names(act_layer) <- meta$BCDE[y]
         return(act_layer)
     })
  5: FUN(X[[i]], ...)
  6: raster(as.character(meta$FILE)[y])
  7: raster(as.character(meta$FILE)[y])
  8: .local(x, ...)
  9: .rasterObjectFromFile(x, band = band, objecttype = "RasterLayer", ...)
  10: stop("Cannot create RasterLayer object from this file; perhaps you need to install rgdal first")
  
  ── 15. Error: satAddLog works as expected for Landsat 8 (@test-satInfo.R#10)  ──
  Cannot create RasterLayer object from this file; perhaps you need to install rgdal first
  1: satellite(files) at testthat/test-satInfo.R:10
  2: satellite(files)
  3: .local(x, ...)
  4: lapply(seq(nrow(meta)), function(y) {
         act_layer <- raster(as.character(meta$FILE)[y])
         names(act_layer) <- meta$BCDE[y]
         return(act_layer)
     })
  5: FUN(X[[i]], ...)
  6: raster(as.character(meta$FILE)[y])
  7: raster(as.character(meta$FILE)[y])
  8: .local(x, ...)
  9: .rasterObjectFromFile(x, band = band, objecttype = "RasterLayer", ...)
  10: stop("Cannot create RasterLayer object from this file; perhaps you need to install rgdal first")
  
  ── 16. Error: maskInvarFeatures works as expected (@test-satInvarFeatures.R#9)  
  Cannot create RasterLayer object from this file; perhaps you need to install rgdal first
  1: satellite(files) at testthat/test-satInvarFeatures.R:9
  2: satellite(files)
  3: .local(x, ...)
  4: lapply(seq(nrow(meta)), function(y) {
         act_layer <- raster(as.character(meta$FILE)[y])
         names(act_layer) <- meta$BCDE[y]
         return(act_layer)
     })
  5: FUN(X[[i]], ...)
  6: raster(as.character(meta$FILE)[y])
  7: raster(as.character(meta$FILE)[y])
  8: .local(x, ...)
  9: .rasterObjectFromFile(x, band = band, objecttype = "RasterLayer", ...)
  10: stop("Cannot create RasterLayer object from this file; perhaps you need to install rgdal first")
  
  ── 17. Error: satellite works as expected for Landsat 4 and 5 files (C1L1) (@tes
  Cannot create RasterLayer object from this file; perhaps you need to install rgdal first
  1: satellite(files) at testthat/test-satellite.R:12
  2: satellite(files)
  3: .local(x, ...)
  4: lapply(seq(nrow(meta)), function(y) {
         act_layer <- raster(as.character(meta$FILE)[y])
         names(act_layer) <- meta$BCDE[y]
         return(act_layer)
     })
  5: FUN(X[[i]], ...)
  6: raster(as.character(meta$FILE)[y])
  7: raster(as.character(meta$FILE)[y])
  8: .local(x, ...)
  9: .rasterObjectFromFile(x, band = band, objecttype = "RasterLayer", ...)
  10: stop("Cannot create RasterLayer object from this file; perhaps you need to install rgdal first")
  
  ── 18. Error: satellite works as expected for Landsat 7 files (C1L1) (@test-sate
  Cannot create RasterLayer object from this file; perhaps you need to install rgdal first
  1: satellite(files) at testthat/test-satellite.R:20
  2: satellite(files)
  3: .local(x, ...)
  4: lapply(seq(nrow(meta)), function(y) {
         act_layer <- raster(as.character(meta$FILE)[y])
         names(act_layer) <- meta$BCDE[y]
         return(act_layer)
     })
  5: FUN(X[[i]], ...)
  6: raster(as.character(meta$FILE)[y])
  7: raster(as.character(meta$FILE)[y])
  8: .local(x, ...)
  9: .rasterObjectFromFile(x, band = band, objecttype = "RasterLayer", ...)
  10: stop("Cannot create RasterLayer object from this file; perhaps you need to install rgdal first")
  
  ── 19. Error: satellite works as expected for Landsat 8 files (C1L1) (@test-sate
  Cannot create RasterLayer object from this file; perhaps you need to install rgdal first
  1: satellite(files) at testthat/test-satellite.R:28
  2: satellite(files)
  3: .local(x, ...)
  4: lapply(seq(nrow(meta)), function(y) {
         act_layer <- raster(as.character(meta$FILE)[y])
         names(act_layer) <- meta$BCDE[y]
         return(act_layer)
     })
  5: FUN(X[[i]], ...)
  6: raster(as.character(meta$FILE)[y])
  7: raster(as.character(meta$FILE)[y])
  8: .local(x, ...)
  9: .rasterObjectFromFile(x, band = band, objecttype = "RasterLayer", ...)
  10: stop("Cannot create RasterLayer object from this file; perhaps you need to install rgdal first")
  
  ── 20. Error: satellite works as expected for 'Raster*' input (C1L1) (@test-sate
  Cannot create RasterLayer object from this file; perhaps you need to install rgdal first
  1: raster::stack(files[-grep("_B8.TIF$", files)]) at testthat/test-satellite.R:35
  2: raster::stack(files[-grep("_B8.TIF$", files)])
  3: .local(x, ...)
  4: stack(rlist, bands = bands, native = native, RAT = RAT)
  5: stack(rlist, bands = bands, native = native, RAT = RAT)
  6: .local(x, ...)
  7: raster(x[[1]], native = native, RAT = RAT, ...)
  8: raster(x[[1]], native = native, RAT = RAT, ...)
  9: .local(x, ...)
  10: .rasterObjectFromFile(x, band = band, objecttype = "RasterLayer", ...)
  11: stop("Cannot create RasterLayer object from this file; perhaps you need to install rgdal first")
  
  ── 21. Error: satellite works as expected for 'list' input (C1L1) (@test-satelli
  Cannot create RasterLayer object from this file; perhaps you need to install rgdal first
  1: lapply(files, raster) at testthat/test-satellite.R:43
  2: FUN(X[[i]], ...)
  3: FUN(X[[i]], ...)
  4: .local(x, ...)
  5: .rasterObjectFromFile(x, band = band, objecttype = "RasterLayer", ...)
  6: stop("Cannot create RasterLayer object from this file; perhaps you need to install rgdal first")
  
  ── 22. Error: satellite works as expected for Landsat 7 files (P1L1) (@test-sate
  Cannot create RasterLayer object from this file; perhaps you need to install rgdal first
  1: satellite(files) at testthat/test-satellite.R:60
  2: satellite(files)
  3: .local(x, ...)
  4: lapply(seq(nrow(meta)), function(y) {
         act_layer <- raster(as.character(meta$FILE)[y])
         names(act_layer) <- meta$BCDE[y]
         return(act_layer)
     })
  5: FUN(X[[i]], ...)
  6: raster(as.character(meta$FILE)[y])
  7: raster(as.character(meta$FILE)[y])
  8: .local(x, ...)
  9: .rasterObjectFromFile(x, band = band, objecttype = "RasterLayer", ...)
  10: stop("Cannot create RasterLayer object from this file; perhaps you need to install rgdal first")
  
  ── 23. Error: satellite works as expected for Landsat 8 files (P1L1) (@test-sate
  Cannot create RasterLayer object from this file; perhaps you need to install rgdal first
  1: satellite(files) at testthat/test-satellite.R:86
  2: satellite(files)
  3: .local(x, ...)
  4: lapply(seq(nrow(meta)), function(y) {
         act_layer <- raster(as.character(meta$FILE)[y])
         names(act_layer) <- meta$BCDE[y]
         return(act_layer)
     })
  5: FUN(X[[i]], ...)
  6: raster(as.character(meta$FILE)[y])
  7: raster(as.character(meta$FILE)[y])
  8: .local(x, ...)
  9: .rasterObjectFromFile(x, band = band, objecttype = "RasterLayer", ...)
  10: stop("Cannot create RasterLayer object from this file; perhaps you need to install rgdal first")
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  [ OK: 64 | SKIPPED: 3 | WARNINGS: 0 | FAILED: 23 ]
  1. Error: calcAtmosCorr for RasterLayers works as expected (@test-calcAtmosCorr.R#8) 
  2. Error: calcAtmosCorr processes all solar bands (@test-calcAtmosCorr.R#46) 
  3. Error: calcAtmosCorr for Satellite works as expected (@test-calcAtmosCorr.R#71) 
  4. Error: calcDODN works as expected (@test-calcDODN.R#8) 
  5. Error: calcPathRadDOS for numeric works as expected (@test-calcPathRadDOS.R#9) 
  6. Error: calcPathRadDOS for Satellite works as expected (@test-calcPathRadDOS.R#53) 
  7. Error: calcTOAIrradModel for 'Satellite' objects works as expected (@test-calcTOAIrradModel.R#26) 
  8. Error: calcTOAIrradRadRef for 'numeric' input works as expected (@test-calcTOAIrradRadRef.R#8) 
  9. Error: calcTOAIrradRadRef for 'numeric' input (P1L1) works as expected (@test-calcTOAIrradRadRef.R#22) 
  1. ...
  
  Error: testthat unit tests failed
  Execution halted