- using R Under development (unstable) (2019-12-11 r77556)
- using platform: x86_64-pc-linux-gnu (64-bit)
- using session charset: ISO8859-15
- checking for file 'seg/DESCRIPTION' ... OK
- this is package 'seg' version '0.5-6'
- checking package namespace information ... OK
- checking package dependencies ... OK
- checking if this is a source package ... OK
- checking if there is a namespace ... OK
- checking for executable files ... OK
- checking for hidden files and directories ... OK
- checking for portable file names ... OK
- checking for sufficient/correct file permissions ... OK
- checking serialization versions ... OK
- checking whether package 'seg' can be installed ... OK
- checking package directory ... OK
- checking for future file timestamps ... OK
- checking DESCRIPTION meta-information ... OK
- checking top-level files ... OK
- checking for left-over files ... OK
- checking index information ... OK
- checking package subdirectories ... OK
- checking R files for non-ASCII characters ... OK
- checking R files for syntax errors ... OK
- checking whether the package can be loaded ... OK
- checking whether the package can be loaded with stated dependencies ... OK
- checking whether the package can be unloaded cleanly ... OK
- checking whether the namespace can be loaded with stated dependencies ... OK
- checking whether the namespace can be unloaded cleanly ... OK
- checking loading without being on the library search path ... OK
- checking use of S3 registration ... OK
- checking dependencies in R code ... OK
- checking S3 generic/method consistency ... OK
- checking replacement functions ... OK
- checking foreign function calls ... OK
- checking R code for possible problems ... [8s/11s] OK
- checking Rd files ... OK
- checking Rd metadata ... OK
- checking Rd line widths ... OK
- checking Rd cross-references ... OK
- checking for missing documentation entries ... OK
- checking for code/documentation mismatches ... OK
- checking Rd \usage sections ... OK
- checking Rd contents ... OK
- checking for unstated dependencies in examples ... OK
- checking contents of 'data' directory ... OK
- checking data for non-ASCII characters ... OK
- checking data for ASCII and uncompressed saves ... OK
- checking line endings in C/C++/Fortran sources/headers ... OK
- checking pragmas in C/C++ headers and code ... OK
- checking compilation flags used ... OK
- checking compiled code ... OK
- checking examples ... ERROR
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: 0x552d378>
<environment: namespace:seg>
--- function search by body ---
Function chksegdata in namespace seg has this body.
----------- END OF FAILURE REPORT --------------
Error in if (class(coords) == "try-error") stop("failed to extract coordinates from 'x'", :
the condition has length > 1
Calls: deseg ... suppressMessages -> withCallingHandlers -> chksegdata
Execution halted
- checking PDF version of manual ... OK
- checking for non-standard things in the check directory ... OK
- DONE
Status: 1 ERROR