Error(s) in re-building vignettes:
  ...
--- re-building 'getstarted.Rmd' using rmarkdown
Loading required package: sp

Attaching package: 'dplyr'

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

    intersect, select, union

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

    filter, lag

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

    intersect, setdiff, setequal, union

 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
landscapemetrics
 --- call from context --- 
FUN(X[[i]], ...)
 --- call from argument --- 
if (class(landscape) != "matrix") {
    landscape <- raster::as.matrix(landscape)
}
 --- R stacktrace ---
where 1: FUN(X[[i]], ...)
where 2: lapply(X = list(landscape), FUN = pad_raster_internal, pad_raster_value = pad_raster_value, 
    pad_raster_cells = pad_raster_cells, global = global)
where 3: pad_raster.matrix(landscape_labeled, pad_raster_value = NA, pad_raster_cells = 1, 
    return_raster = FALSE)
where 4: pad_raster(landscape_labeled, pad_raster_value = NA, pad_raster_cells = 1, 
    return_raster = FALSE)
where 5: FUN(X[[i]], ...)
where 6: lapply(classes, function(patches_class) {
    landscape_labeled <- get_patches(landscape, class = patches_class, 
        directions = directions, return_raster = FALSE)[[1]]
    landscape_labeled <- pad_raster(landscape_labeled, pad_raster_value = NA, 
        pad_raster_cells = 1, return_raster = FALSE)[[1]]
    target_na <- which(is.na(landscape_labeled))
    landscape_labeled[target_na] <- -999
    if (resolution_x == resolution_y) {
        neighbour_matrix <- rcpp_get_coocurrence_matrix(landscape_labeled, 
            directions = as.matrix(4))
        perimeter_patch_ij <- neighbour_matrix[1, 2:ncol(neighbour_matrix)] * 
            resolution_x
    }
    else {
        left_right_neighbours <- rcpp_get_coocurrence_matrix(landscape_labeled, 
            directions = as.matrix(left_right_matrix))
        perimeter_patch_ij_left_right <- left_right_neighbours[1, 
            2:ncol(left_right_neighbours)] * resolution_x
        top_bottom_neighbours <- rcpp_get_coocurrence_matrix(landscape_labeled, 
            directions = as.matrix(top_bottom_matrix))
        perimeter_patch_ij_top_bottom <- top_bottom_neighbours[1, 
            2:ncol(top_bottom_neighbours)] * resolution_y
        perimeter_patch_ij <- perimeter_patch_ij_top_bottom + 
            perimeter_patch_ij_left_right
    }
    tibble::tibble(class = patches_class, value = perimeter_patch_ij)
})
where 7: do.call(rbind, lapply(classes, function(patches_class) {
    landscape_labeled <- get_patches(landscape, class = patches_class, 
        directions = directions, return_raster = FALSE)[[1]]
    landscape_labeled <- pad_raster(landscape_labeled, pad_raster_value = NA, 
        pad_raster_cells = 1, return_raster = FALSE)[[1]]
    target_na <- which(is.na(landscape_labeled))
    landscape_labeled[target_na] <- -999
    if (resolution_x == resolution_y) {
        neighbour_matrix <- rcpp_get_coocurrence_matrix(landscape_labeled, 
            directions = as.matrix(4))
        perimeter_patch_ij <- neighbour_matrix[1, 2:ncol(neighbour_matrix)] * 
            resolution_x
    }
    else {
        left_right_neighbours <- rcpp_get_coocurrence_matrix(landscape_labeled, 
            directions = as.matrix(left_right_matrix))
        perimeter_patch_ij_left_right <- left_right_neighbours[1, 
            2:ncol(left_right_neighbours)] * resolution_x
        top_bottom_neighbours <- rcpp_get_coocurrence_matrix(landscape_labeled, 
            directions = as.matrix(top_bottom_matrix))
        perimeter_patch_ij_top_bottom <- top_bottom_neighbours[1, 
            2:ncol(top_bottom_neighbours)] * resolution_y
        perimeter_patch_ij <- perimeter_patch_ij_top_bottom + 
            perimeter_patch_ij_left_right
    }
    tibble::tibble(class = patches_class, value = perimeter_patch_ij)
}))
where 8: FUN(X[[i]], ...)
where 9: lapply(X = raster::as.list(landscape), FUN = lsm_p_perim_calc, 
    directions = directions)
where 10: lsm_p_perim.RasterLayer(landscape)
where 11: lsm_p_perim(landscape)
where 12: eval(expr, envir, enclos)
where 13: eval(expr, envir, enclos)
where 14: withVisible(eval(expr, envir, enclos))
where 15: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler, 
    error = eHandler, message = mHandler)
where 16: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir, 
    enclos)), warning = wHandler, error = eHandler, message = mHandler))
where 17: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr, 
    envir, enclos)), warning = wHandler, error = eHandler, message = mHandler)))
where 18: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos, 
    debug = debug, last = i == length(out), use_try = stop_on_error != 
        2L, keep_warning = keep_warning, keep_message = keep_message, 
    output_handler = output_handler, include_timing = include_timing)
where 19: evaluate::evaluate(...)
where 20: evaluate(code, envir = env, new_device = FALSE, keep_warning = !isFALSE(options$warning), 
    keep_message = !isFALSE(options$message), stop_on_error = if (options$error && 
        options$include) 0L else 2L, output_handler = knit_handlers(options$render, 
        options))
where 21: in_dir(input_dir(), evaluate(code, envir = env, new_device = FALSE, 
    keep_warning = !isFALSE(options$warning), keep_message = !isFALSE(options$message), 
    stop_on_error = if (options$error && options$include) 0L else 2L, 
    output_handler = knit_handlers(options$render, options)))
where 22: block_exec(params)
where 23: call_block(x)
where 24: process_group.block(group)
where 25: process_group(group)
where 26: withCallingHandlers(if (tangle) process_tangle(group) else process_group(group), 
    error = function(e) {
        setwd(wd)
        cat(res, sep = "\n", file = output %n% "")
        message("Quitting from lines ", paste(current_lines(i), 
            collapse = "-"), " (", knit_concord$get("infile"), 
            ") ")
    })
where 27: process_file(text, output)
where 28: knitr::knit(knit_input, knit_output, envir = envir, quiet = quiet, 
    encoding = encoding)
where 29: rmarkdown::render(file, encoding = encoding, quiet = quiet, envir = globalenv(), 
    ...)
where 30: vweave_rmarkdown(...)
where 31: engine$weave(file, quiet = quiet, encoding = enc)
where 32: doTryCatch(return(expr), name, parentenv, handler)
where 33: tryCatchOne(expr, names, parentenv, handlers[[1L]])
where 34: tryCatchList(expr, classes, parentenv, handlers)
where 35: 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)
    }
    outputs <- c(outputs, output)
}, error = function(e) {
    thisOK <<- FALSE
    fails <<- c(fails, file)
    message(gettextf("Error: processing vignette '%s' failed with diagnostics:\n%s", 
        file, conditionMessage(e)))
})
where 36: tools:::buildVignettes(dir = "/home/hornik/tmp/R.check/r-devel-clang/Work/PKGS/landscapemetrics.Rcheck/vign_test/landscapemetrics", 
    ser_elibs = "/tmp/RtmpJrPLGu/file48c039fd0489.rds")

 --- value of length: 2 type: logical ---
[1] FALSE  TRUE
 --- function from context --- 
function (landscape, pad_raster_value, pad_raster_cells, global) 
{
    if (class(landscape) != "matrix") {
        landscape <- raster::as.matrix(landscape)
    }
    y_direction <- matrix(rep(x = pad_raster_value, times = ncol(landscape) * 
        pad_raster_cells), nrow = pad_raster_cells)
    landscape_padded <- rbind(y_direction, landscape, y_direction, 
        deparse.level = 0)
    x_direction <- matrix(rep(x = pad_raster_value, times = nrow(landscape_padded) * 
        pad_raster_cells), ncol = pad_raster_cells)
    landscape_padded <- cbind(x_direction, landscape_padded, 
        x_direction, deparse.level = 0)
    if (global) {
        landscape_padded[is.na(landscape_padded)] <- pad_raster_value
    }
    return(landscape_padded)
}
<bytecode: 0x7ccfd98>
<environment: namespace:landscapemetrics>
 --- function search by body ---
Function pad_raster_internal in namespace landscapemetrics has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1