Error(s) in re-building vignettes:
  ...
--- re-building 'Hsdar-intro.Rnw' using Sweave
Loading required package: raster
Loading required package: sp
Loading required package: rgdal
rgdal: version: 1.4-8, (SVN revision 845)
 Geospatial Data Abstraction Library extensions to R successfully loaded
 Loaded GDAL runtime: GDAL 2.4.3, released 2019/10/28
 Path to GDAL shared files: /usr/share/gdal
 GDAL binary built with GEOS: TRUE 
 Loaded PROJ.4 runtime: Rel. 6.2.1, November 1st, 2019, [PJ_VERSION: 621]
 Path to PROJ.4 shared files: (autodetected)
 Linking to sp version: 1.3-2 
Loading required package: signal

Attaching package: 'signal'

The following object is masked from 'package:raster':

    resample

The following objects are masked from 'package:stats':

    filter, poly

Loading required package: caret
Loading required package: lattice
Loading required package: ggplot2

###################################
  This is hsdar 1.0.0
  To get citation entry type
      'citation("hsdar")'
###################################

Attaching package: 'hsdar'

The following object is masked from 'package:raster':

    nbands

 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
hsdar
 --- call from context --- 
.createspeclib(spectra, wavelength, ...)
 --- call from argument --- 
if (class(spectra) %in% c("RasterBrick", "HyperSpecRaster")) {
    fromRaster <- TRUE
} else {
    if (class(spectra) == "RasterLayer") {
        spectra <- brick(spectra)
        fromRaster <- TRUE
    }
    else {
        fromRaster <- FALSE
        dim_spectra <- c(nrow(spectra), ncol(spectra))
    }
}
 --- R stacktrace ---
where 1: .createspeclib(spectra, wavelength, ...)
where 2: speclib(spectra, wavelength)
where 3: speclib(spectra, wavelength)
where 4: eval(expr, .GlobalEnv)
where 5: eval(expr, .GlobalEnv)
where 6: withVisible(eval(expr, .GlobalEnv))
where 7: doTryCatch(return(expr), name, parentenv, handler)
where 8: tryCatchOne(expr, names, parentenv, handlers[[1L]])
where 9: tryCatchList(expr, classes, parentenv, handlers)
where 10: tryCatch(expr, error = function(e) {
    call <- conditionCall(e)
    if (!is.null(call)) {
        if (identical(call[[1L]], quote(doTryCatch))) 
            call <- sys.call(-4L)
        dcall <- deparse(call)[1L]
        prefix <- paste("Error in", dcall, ": ")
        LONG <- 75L
        sm <- strsplit(conditionMessage(e), "\n")[[1L]]
        w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
        if (is.na(w)) 
            w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L], 
                type = "b")
        if (w > LONG) 
            prefix <- paste0(prefix, "\n  ")
    }
    else prefix <- "Error : "
    msg <- paste0(prefix, conditionMessage(e), "\n")
    .Internal(seterrmessage(msg[1L]))
    if (!silent && isTRUE(getOption("show.error.messages"))) {
        cat(msg, file = outFile)
        .Internal(printDeferredWarnings())
    }
    invisible(structure(msg, class = "try-error", condition = e))
})
where 11: try(withVisible(eval(expr, .GlobalEnv)), silent = TRUE)
where 12: evalFunc(ce, options)
where 13: tryCatchList(expr, classes, parentenv, handlers)
where 14: tryCatch(evalFunc(ce, options), finally = {
    cat("\n")
    sink()
})
where 15: driver$runcode(drobj, chunk, chunkopts)
where 16: utils::Sweave(...)
where 17: engine$weave(file, quiet = quiet, encoding = enc)
where 18: doTryCatch(return(expr), name, parentenv, handler)
where 19: tryCatchOne(expr, names, parentenv, handlers[[1L]])
where 20: tryCatchList(expr, classes, parentenv, handlers)
where 21: tryCatch({
    engine$weave(file, quiet = quiet, encoding = enc)
    setwd(startdir)
    output <- find_vignette_product(name, by = "weave", engine = engine)
    if (!have.makefile && vignette_is_tex(output)) {
        texi2pdf(file = output, clean = FALSE, quiet = quiet)
        output <- find_vignette_product(name, by = "texi2pdf", 
            engine = engine)
    }
}, error = function(e) {
    OK <<- FALSE
    message(gettextf("Error: processing vignette '%s' failed with diagnostics:\n%s", 
        file, conditionMessage(e)))
})
where 22: tools:::.buildOneVignette("Hsdar-intro.Rnw", "/home/hornik/tmp/R.check/r-devel-clang/Work/PKGS/hsdar.Rcheck/vign_test/hsdar", 
    TRUE, FALSE, "Hsdar-intro", "CP1252", "/tmp/RtmpqrMlld/file9115c4a279f.rds")

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (spectra, wavelength, fwhm = NULL, SI = NULL, usagehistory = NULL, 
    transformation = NULL, continuousdata = "auto", wlunit = "nm", 
    xlabel = "Wavelength", ylabel = "Reflectance", rastermeta = NULL) 
{
    if (class(spectra) %in% c("RasterBrick", "HyperSpecRaster")) {
        fromRaster <- TRUE
    }
    else {
        if (class(spectra) == "RasterLayer") {
            spectra <- brick(spectra)
            fromRaster <- TRUE
        }
        else {
            fromRaster <- FALSE
            dim_spectra <- c(nrow(spectra), ncol(spectra))
        }
    }
    wavelength.is.range <- FALSE
    if (class(wavelength) == "data.frame" || class(wavelength) == 
        "matrix") {
        wavelength <- as.data.frame(wavelength)
        if (ncol(wavelength) == 1) {
            wavelength <- as.vector(wavelength)
            if (!is.null(fwhm)) 
                if (length(fwhm) != length(wavelength)) 
                  stop("Length of fwhm and wavelength differ")
            if (!fromRaster) {
                if (length(wavelength) == dim_spectra[1]) {
                  if (length(wavelength) == dim_spectra[2]) {
                    warning("Could not determine orientation of spectra data. \n  \n                    Make sure that columns are wavelength and rows samples")
                  }
                  else {
                    spectra <- t(spectra)
                  }
                }
            }
        }
        else {
            wavelength.is.range <- TRUE
            if (!fromRaster) {
                if (nrow(wavelength) == dim_spectra[1]) {
                  if (nrow(wavelength) == dim_spectra[2]) {
                    warning("Could not determine orientation of spectra data. \n  \n                    Make sure that columns are wavelength and rows samples")
                  }
                  else {
                    spectra <- t(spectra)
                  }
                }
            }
        }
    }
    else {
        if (!is.null(fwhm)) {
            wavelength.is.range <- TRUE
            if (length(fwhm) != length(wavelength)) 
                stop("Length of fwhm and wavelength differ")
        }
        if (!fromRaster) {
            if (length(wavelength) == dim_spectra[1]) {
                if (length(wavelength) == dim_spectra[2]) {
                  warning("Could not determine orientation of spectra data. \n  \n                  Make sure that columns are bands and rows different samples")
                }
                else {
                  spectra <- t(spectra)
                }
            }
        }
    }
    if (!fromRaster) {
        names <- NULL
        rn <- row.names(spectra)
        if (!is.null(rn)) {
            rn <- as.factor(rn)
            if (nlevels(rn) != length(rn)) {
                warning("  some row.names duplicated: --> Spectra does not have IDs")
                rn <- as.factor(1:length(rn))
            }
            rn <- as.character(rn)
        }
        else {
            rn <- character()
        }
        spectra <- as.matrix(spectra)
        cn <- colnames(spectra)
        rownames(spectra) <- NULL
        colnames(spectra) <- NULL
    }
    else {
        cn <- c(1:spectra@data@nlayers)
        rn <- character()
    }
    if (!wavelength.is.range) {
        if (length(wavelength) > 1) {
            range <- wavelength[-1] - wavelength[-1 * length(wavelength)]
            range <- c(as.numeric(range), range[length(range)])
            if (sd(range) == 0) 
                range <- mean(range)
            fwhm <- range
        }
        else {
            fwhm <- 1
        }
    }
    else {
        if (!is.null(fwhm)) {
            if (is.data.frame(wavelength)) 
                wavelength <- rowMeans(wavelength)
        }
    }
    if (is.null(SI)) 
        SI <- data.frame()
    if (is.null(usagehistory)) 
        usagehistory <- character()
    if (is.null(transformation)) 
        transformation <- character()
    if (is.null(rastermeta)) 
        rastermeta <- list()
    wavelength <- wavelength * .ConvWlFwd(wlunit)
    fwhm <- fwhm * .ConvWlFwd(wlunit)
    result <- new("Speclib", spectra = spectra, wavelength = wavelength, 
        fwhm = fwhm, wavelength.is.range = wavelength.is.range, 
        continuousdata = continuousdata, SI = SI, transformation = transformation, 
        usagehistory = usagehistory, wlunit = wlunit, xlabel = xlabel, 
        ylabel = ylabel, rastermeta = rastermeta)
    idSpeclib(result) <- rn
    bandnames(result) <- cn
    if (validObject(result)) {
        return(result)
    }
}
<bytecode: 0x1141eaa0>
<environment: namespace:hsdar>
 --- function search by body ---
Function .createspeclib in namespace hsdar has this body.
 ----------- END OF FAILURE REPORT -------------- 

Error: processing vignette 'Hsdar-intro.Rnw' failed with diagnostics:
 chunk 10 
Error in if (class(spectra) %in% c("RasterBrick", "HyperSpecRaster")) { : 
  the condition has length > 1

--- failed re-building 'Hsdar-intro.Rnw'

--- re-building 'References.Rnw' using Sweave
--- finished re-building 'References.Rnw'

SUMMARY: processing the following file failed:
  'Hsdar-intro.Rnw'

Error: Vignette re-building failed.
Execution halted