Running examples in ‘seg-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: deseg
> ### Title: Decomposable Segregation Measure
> ### Aliases: deseg
> 
> ### ** Examples
> 
> # uses the idealised landscapes in 'segdata'
> data(segdata)
> grd <- GridTopology(cellcentre.offset=c(0.5,0.5),
+                     cellsize=c(1,1), cells.dim=c(10,10))
> grd.sp <- as.SpatialPolygons.GridTopology(grd)
> 
> # displays the test data
> plot(grd.sp)
> plot(grd.sp[segdata[,9] == 100,], col = "Black", add = TRUE)
> plot(grd.sp[segdata[,9] == 50,], col = "Grey", add = TRUE)
> 
> # tries different bandwidths for the same data
> bw1 <- deseg(grd.sp, segdata[,9:10], sigma = 1, nrow = 20, ncol = 20)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
seg
 --- call from context --- 
chksegdata(x, data)
 --- call from argument --- 
if (class(coords) == "try-error") stop("failed to extract coordinates from 'x'", 
    call. = FALSE)
 --- R stacktrace ---
where 1: chksegdata(x, data)
where 2: withCallingHandlers(expr, message = function(c) invokeRestart("muffleMessage"))
where 3: suppressMessages(chksegdata(x, data))
where 4: deseg(grd.sp, segdata[, 9:10], sigma = 1, nrow = 20, ncol = 20)

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (x, data) 
{
    begTime <- Sys.time()
    fn <- match.call()[[1]]
    proj4string <- as.character(NA)
    if (inherits(x, "Spatial")) {
        message(fn, ": 'x' is an object of class \"Spatial\"")
        coords <- try(coordinates(x), silent = TRUE)
        if (class(coords) == "try-error") 
            stop("failed to extract coordinates from 'x'", call. = FALSE)
        message(fn, ": ", nrow(coords), " coordinates extracted from 'x'")
        if (missing(data)) {
            data <- try(as.matrix(x@data), silent = TRUE)
            if (class(data) == "try-error") 
                stop("'data' is missing, with no default", call. = FALSE)
            message(fn, ": 'data' is missing, use the one attached to 'x'")
        }
        else {
            data <- as.matrix(data)
        }
        message(fn, ": check if 'data' has any NA values")
        removeNA <- which(apply(data, 1, function(z) any(is.na(z))))
        if (length(removeNA) > 0) {
            data <- data[-removeNA, ]
            coords <- coords[-removeNA, ]
            message(fn, ": ", length(removeNA), "NA(s) removed")
        }
        message(fn, ": retrieves projection information from 'x'")
        proj4string <- as.character(x@proj4string@projargs)
    }
    else if (is(x, "ppp")) {
        message(fn, ": 'x' is an object of class \"ppp\"")
        coords <- cbind(x = x$x, y = x$y)
        if (missing(data)) {
            if (is.null(x$marks)) {
                stop("'data' is missing, with no default", call. = FALSE)
            }
            else {
                data <- as.matrix(x$marks)
                message(fn, ": 'data' is missing, use the one attached to 'x'")
            }
        }
        else {
            data <- as.matrix(data)
        }
    }
    else if (is.matrix(x) || is.data.frame(x)) {
        message(fn, ": 'x' is an object of class \"matrix\" or \"data.frame\"")
        coords <- as.matrix(x)
        if (ncol(coords) != 2 || !is.numeric(coords)) 
            stop("'x' must be a numeric matrix with two columns", 
                call. = FALSE)
        if (missing(data)) 
            stop("'data' is missing, with no default", call. = FALSE)
        else data <- as.matrix(data)
    }
    else stop("invalid object 'x'", call. = FALSE)
    if (ncol(data) < 2 || !is.numeric(data)) 
        stop("'data' must be a numeric matrix with at least two columns", 
            call. = FALSE)
    else if (nrow(data) != nrow(coords)) 
        stop("'data' must have the same number of rows as 'x'", 
            call. = FALSE)
    tt <- as.numeric(difftime(Sys.time(), begTime, units = "sec"))
    message(fn, ": done! [", tt, " seconds]")
    colnames(coords) <- c("x", "y")
    list(coords = coords, data = data, proj4string = proj4string)
}
<bytecode: 0x55f4f077d7f0>
<environment: namespace:seg>
 --- function search by body ---
Function chksegdata in namespace seg has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1