Last updated on 2019-11-26 00:52:13 CET.
Flavor | Version | Tinstall | Tcheck | Ttotal | Status | Flags |
---|---|---|---|---|---|---|
r-devel-linux-x86_64-debian-clang | 1.0.0.3 | 15.11 | 113.76 | 128.87 | ERROR | |
r-devel-linux-x86_64-debian-gcc | 1.0.0.3 | 15.52 | 88.58 | 104.10 | ERROR | |
r-devel-linux-x86_64-fedora-clang | 1.0.0.3 | 185.19 | OK | |||
r-devel-linux-x86_64-fedora-gcc | 1.0.0.3 | 186.23 | OK | |||
r-devel-windows-ix86+x86_64 | 1.0.0.3 | 38.00 | 155.00 | 193.00 | OK | |
r-devel-windows-ix86+x86_64-gcc8 | 1.0.0.3 | 25.00 | 149.00 | 174.00 | OK | |
r-patched-linux-x86_64 | 1.0.0.3 | 14.97 | 140.76 | 155.73 | OK | |
r-patched-solaris-x86 | 1.0.0.3 | 256.10 | OK | |||
r-release-linux-x86_64 | 1.0.0.3 | 13.36 | 144.80 | 158.16 | OK | |
r-release-windows-ix86+x86_64 | 1.0.0.3 | 33.00 | 149.00 | 182.00 | OK | |
r-release-osx-x86_64 | 1.0.0.3 | OK | ||||
r-oldrel-windows-ix86+x86_64 | 1.0.0.3 | 19.00 | 202.00 | 221.00 | OK | |
r-oldrel-osx-x86_64 | 1.0.0.3 | OK |
Version: 1.0.0.3
Check: examples
Result: ERROR
Running examples in 'spsur-Ex.R' failed
The error most likely occurred in:
> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: dgp_spsur
> ### Title: Generation of a random dataset with a spatial SUR structure.
> ### Aliases: dgp_spsur
>
> ### ** Examples
>
> ####################################
> ######## CROSS SECTION DATA ########
> ####################################
>
> ####################################
> #### Example 1: DGP SLM model
> ####################################
> rm(list = ls()) # Clean memory
> Tm <- 1 # Number of time periods
> G <- 3 # Number of equations
> N <- 50 # Number of spatial elements
> p <- 3 # Number of independent variables
> Sigma <- matrix(0.3, ncol = G, nrow = G)
> diag(Sigma) <- 1
> Betas <- c(1,2,3,1,-1,0.5,1,-0.5,2)
> lambda <- 0.5 # level of spatial dependence
> rho <- 0.0 # spatial autocorrelation error term = 0
> # random coordinates
> co <- cbind(runif(N,0,1),runif(N,0,1))
> W <- spdep::nb2mat(spdep::knn2nb(spdep::knearneigh(co, k = 5,
+ longlat = FALSE)))
> DGP <- dgp_spsur(Sigma = Sigma, Betas = Betas,
+ rho = rho, lambda = lambda, Tm = Tm,
+ G = G, N = N, p = p, W = W)
----------- FAILURE REPORT --------------
--- failure: the condition has length > 1 ---
--- srcref ---
:
--- package (from environment) ---
spsur
--- call from context ---
dgp_spsur(Sigma = Sigma, Betas = Betas, rho = rho, lambda = lambda,
Tm = Tm, G = G, N = N, p = p, W = W)
--- call from argument ---
if (class(W) != "matrix") W <- as.matrix(W)
--- R stacktrace ---
where 1: dgp_spsur(Sigma = Sigma, Betas = Betas, rho = rho, lambda = lambda,
Tm = Tm, G = G, N = N, p = p, W = W)
--- value of length: 2 type: logical ---
[1] FALSE TRUE
--- function from context ---
function (Sigma, Tm = 1, G, N, Betas, Thetas = NULL, rho = NULL,
lambda = NULL, p = NULL, W = NULL, X = NULL, pdfU = "nvrnorm",
pdfX = "nvrnorm")
{
if (!is.null(W)) {
if (class(W) != "matrix")
W <- as.matrix(W)
rsumW <- rowSums(W)
rsumW[rsumW == 0] <- 1
nW <- dim(W)[1]
W <- W/matrix(rep(rsumW, each = nW), nrow = nW, ncol = nW,
byrow = TRUE)
W <- Matrix::Matrix(W)
}
else W <- Matrix::Diagonal(N)
if (Tm > 1 && G == 1) {
G <- Tm
Tm <- 1
}
if (!is.null(Thetas))
durbin <- TRUE
else durbin <- FALSE
if (!is.null(p) & length(p) == 1)
p <- matrix(p, nrow = G, ncol = 1)
if (is.null(lambda))
lambda <- rep(0, G)
if (is.null(rho))
rho <- rep(0, G)
if (length(lambda) == 1)
lambda <- as.numeric(matrix(lambda, nrow = G, ncol = 1))
if (length(rho) == 1)
rho <- as.numeric(matrix(rho, nrow = G, ncol = 1))
if (is.null(X)) {
if (is.null(p))
stop("Arguments X and p can not be NULL simultaneously")
if (pdfX == "nvrunif") {
X <- cbind(matrix(1, N, 1), matrix(runif(N * (p[1] -
1)), N, (p[1] - 1)))
for (i in 1:(G - 1)) {
X <- Matrix::bdiag(X, cbind(matrix(1, N, 1),
matrix(runif(N * (p[i + 1] - 1)), N, (p[i +
1] - 1))))
}
if (Tm > 1) {
for (i in 1:(Tm - 1)) {
X2 <- cbind(matrix(1, N, 1), matrix(runif(N *
(p[1] - 1)), N, (p[1] - 1)))
for (i in 1:(G - 1)) {
X2 <- Matrix::bdiag(X2, cbind(matrix(1, N,
1), matrix(runif(N * (p[i + 1] - 1)), N,
(p[i + 1] - 1))))
}
X <- rbind(X, X2)
}
}
}
else if (pdfX == "nvrnorm") {
X <- cbind(matrix(1, N, 1), matrix(rnorm(N * (p[1] -
1), 0, 1), N, (p[1] - 1)))
for (i in 1:(G - 1)) {
X <- Matrix::bdiag(X, cbind(matrix(1, N, 1),
matrix(rnorm(N * (p[i + 1] - 1), 0, 1), N,
(p[i + 1] - 1))))
}
if (Tm > 1) {
for (i in 1:(Tm - 1)) {
X2 <- cbind(matrix(1, N, 1), matrix(rnorm(N *
(p[1] - 1), 0, 1), N, (p[1] - 1)))
for (i in 1:(G - 1)) {
X2 <- Matrix::bdiag(X2, cbind(matrix(1, N,
1), matrix(rnorm(N * (p[i + 1] - 1), 0,
1), N, (p[i + 1] - 1))))
}
X <- rbind(X, X2)
}
}
}
else stop("pdfX only can be nvrnorm or nvrunif")
nam <- c(paste0("Intercep_", 1), paste(paste0("X", 1,
"_"), 1:(p[1] - 1), sep = ""))
if (length(p > 1)) {
for (i in 2:(length(p))) {
nam <- c(nam, c(paste0("Intercep_", i), paste(paste0("X",
i, "_"), 1:(p[i] - 1), sep = "")))
}
}
dimnames(X)[[2]] <- nam
}
if (is.null(p)) {
if ((ncol(X)%%G) != 0)
stop("Argument p need to be set")
p <- rep(ncol(X)/G, G)
}
IT <- Matrix::Diagonal(Tm)
IR <- Matrix::Diagonal(N)
IG <- Matrix::Diagonal(G)
IGR <- Matrix::Diagonal(G * N)
if (durbin) {
WX <- (IT %x% IG %x% W) %*% X
dimnames(WX)[[2]] <- paste0("W_", colnames(X))
Xdurbin <- NULL
pdurbin <- p - 1
for (i in 1:length(p)) {
if (i == 1) {
Xdurbin <- cbind(X[, 1:p[i]], WX[, 2:p[i]])
Coeff <- c(Betas[1:p[1]], Thetas[1:pdurbin[1]])
}
else {
Xdurbin <- cbind(Xdurbin, X[, (cumsum(p)[i -
1] + 1):cumsum(p)[i]], WX[, (cumsum(p)[i -
1] + 2):cumsum(p)[i]])
Coeff <- c(Coeff, Betas[(cumsum(p)[i - 1] + 1):cumsum(p)[i]],
Thetas[(cumsum(pdurbin)[i - 1] + 1):cumsum(pdurbin)[i]])
}
}
}
S <- Sigma
OME <- (IT %x% S) %x% IR
chol_OME <- Matrix::Cholesky(OME)
M <- Matrix::Matrix(0, ncol = 1, nrow = Tm * G * N)
U <- matrix(sparseMVN::rmvn.sparse(n = 1, mu = M, CH = chol_OME,
prec = FALSE), ncol = 1)
U <- Matrix::Matrix(U)
if (pdfU == "lognvrnorm")
U <- exp(U)
if (pdfU != "lognvrnorm" && pdfU != "nvrnorm")
print(" Improper pdf. The errors will be drawn from a multivariate Normal ")
IBU <- Matrix::solve(IT %x% (IGR - diag(rho) %x% W), U)
if (durbin) {
Y <- Matrix::solve(IT %x% (IGR - diag(lambda) %x% W),
(Xdurbin %*% Coeff + IBU))
}
else {
Y <- Matrix::solve(IT %x% (IGR - diag(lambda) %x% W),
(X %*% Betas + IBU))
}
results <- list(X = as.matrix(X), Y = as.matrix(Y))
}
<bytecode: 0x4d4d340>
<environment: namespace:spsur>
--- function search by body ---
Function dgp_spsur in namespace spsur has this body.
----------- END OF FAILURE REPORT --------------
Fatal error: the condition has length > 1
Flavor: r-devel-linux-x86_64-debian-clang
Version: 1.0.0.3
Check: re-building of vignette outputs
Result: WARN
Error(s) in re-building vignettes:
...
--- re-building 'spsur-vignette.Rmd' using rmarkdown
----------- FAILURE REPORT --------------
--- failure: the condition has length > 1 ---
--- srcref ---
:
--- package (from environment) ---
spsur
--- call from context ---
lmtestspsur(Form = spcformula, data = spc, W = Wspc)
--- call from argument ---
if (class(W) != "matrix") W <- as.matrix(W)
--- R stacktrace ---
where 1: lmtestspsur(Form = spcformula, data = spc, W = Wspc)
where 2: eval(expr, envir, enclos)
where 3: eval(expr, envir, enclos)
where 4: withVisible(eval(expr, envir, enclos))
where 5: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler,
error = eHandler, message = mHandler)
where 6: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir,
enclos)), warning = wHandler, error = eHandler, message = mHandler))
where 7: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr,
envir, enclos)), warning = wHandler, error = eHandler, message = mHandler)))
where 8: 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 9: evaluate::evaluate(...)
where 10: 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 11: 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 12: block_exec(params)
where 13: call_block(x)
where 14: process_group.block(group)
where 15: process_group(group)
where 16: 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 17: process_file(text, output)
where 18: knitr::knit(knit_input, knit_output, envir = envir, quiet = quiet,
encoding = encoding)
where 19: rmarkdown::render(file, encoding = encoding, quiet = quiet, envir = globalenv(),
...)
where 20: vweave_rmarkdown(...)
where 21: engine$weave(file, quiet = quiet, encoding = enc)
where 22: doTryCatch(return(expr), name, parentenv, handler)
where 23: tryCatchOne(expr, names, parentenv, handlers[[1L]])
where 24: tryCatchList(expr, classes, parentenv, handlers)
where 25: 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 26: tools:::buildVignettes(dir = "/home/hornik/tmp/R.check/r-devel-clang/Work/PKGS/spsur.Rcheck/vign_test/spsur",
ser_elibs = "/tmp/RtmpZ5zyTk/file7e235b30fb4b.rds")
--- value of length: 2 type: logical ---
[1] FALSE TRUE
--- function from context ---
function (Form = NULL, data = NULL, W = NULL, X = NULL, Y = NULL,
time = NULL, G = NULL, N = NULL, Tm = NULL, print_table = TRUE)
{
if (is.null(W))
stop("W matrix is needed")
if (!is.null(W)) {
if (class(W) != "matrix")
W <- as.matrix(W)
rsumW <- rowSums(W)
rsumW[rsumW == 0] <- 1
nW <- dim(W)[1]
W <- W/matrix(rep(rsumW, each = nW), nrow = nW, ncol = nW,
byrow = TRUE)
W <- Matrix::Matrix(W)
}
if (is.null(time)) {
if (!is.null(Form) && !is.null(data)) {
if (!any(class(Form) == "Formula"))
Form <- Formula::Formula(Form)
get_XY <- get_data_spsur(formula = Form, data = data,
W = W)
Y <- get_XY$Y
X <- get_XY$X
G <- get_XY$G
N <- get_XY$N
Tm <- get_XY$Tm
p <- get_XY$p
rm(get_XY)
}
else {
if (G == 1 && Tm > 1) {
G <- Tm
Tm <- 1
}
}
}
else {
if (class(time) != "factor")
time <- as.factor(time)
time <- droplevels(time)
if (length(time) != nrow(data))
stop("time must have same length than the\n number of rows in data")
mt <- terms(Form)
G <- length(levels(time))
Ylist <- vector("list", G)
Xlist <- vector("list", G)
p <- NULL
namesX <- NULL
levels_time <- levels(time)
for (i in 1:G) {
data_i <- model.frame(mt, data = data[time == levels_time[i],
])
Ylist[[i]] <- data_i[, 1]
Xlist[[i]] <- model.matrix(mt, data = data[time ==
levels_time[i], ])
p <- c(p, ncol(Xlist[[i]]))
namesX <- c(namesX, paste(colnames(Xlist[[i]]), i,
sep = "_"))
}
Y <- matrix(unlist(Ylist), ncol = 1)
X <- as.matrix(Matrix::bdiag(Xlist))
colnames(X) <- namesX
N <- length(Ylist[[1]])
Tm <- 1
}
res <- sur3_spdiag(Tm = Tm, G = G, N = N, Y = Y, X = X, W = W)
table_results <- cbind(res$stat, res$df, pchisq(res$stat,
res$df, lower.tail = FALSE))
rownames(table_results) <- res$stat_names
colnames(table_results) <- c("LM-Stat.", "DF", "p-value")
if (print_table)
printCoefmat(table_results, P.values = TRUE, has.Pvalue = TRUE,
digits = 4)
return(res)
}
<bytecode: 0x71b2f50>
<environment: namespace:spsur>
--- function search by body ---
Function lmtestspsur in namespace spsur has this body.
----------- END OF FAILURE REPORT --------------
Fatal error: the condition has length > 1
Flavor: r-devel-linux-x86_64-debian-clang
Version: 1.0.0.3
Check: examples
Result: ERROR
Running examples in ‘spsur-Ex.R’ failed
The error most likely occurred in:
> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: dgp_spsur
> ### Title: Generation of a random dataset with a spatial SUR structure.
> ### Aliases: dgp_spsur
>
> ### ** Examples
>
> ####################################
> ######## CROSS SECTION DATA ########
> ####################################
>
> ####################################
> #### Example 1: DGP SLM model
> ####################################
> rm(list = ls()) # Clean memory
> Tm <- 1 # Number of time periods
> G <- 3 # Number of equations
> N <- 50 # Number of spatial elements
> p <- 3 # Number of independent variables
> Sigma <- matrix(0.3, ncol = G, nrow = G)
> diag(Sigma) <- 1
> Betas <- c(1,2,3,1,-1,0.5,1,-0.5,2)
> lambda <- 0.5 # level of spatial dependence
> rho <- 0.0 # spatial autocorrelation error term = 0
> # random coordinates
> co <- cbind(runif(N,0,1),runif(N,0,1))
> W <- spdep::nb2mat(spdep::knn2nb(spdep::knearneigh(co, k = 5,
+ longlat = FALSE)))
> DGP <- dgp_spsur(Sigma = Sigma, Betas = Betas,
+ rho = rho, lambda = lambda, Tm = Tm,
+ G = G, N = N, p = p, W = W)
----------- FAILURE REPORT --------------
--- failure: the condition has length > 1 ---
--- srcref ---
:
--- package (from environment) ---
spsur
--- call from context ---
dgp_spsur(Sigma = Sigma, Betas = Betas, rho = rho, lambda = lambda,
Tm = Tm, G = G, N = N, p = p, W = W)
--- call from argument ---
if (class(W) != "matrix") W <- as.matrix(W)
--- R stacktrace ---
where 1: dgp_spsur(Sigma = Sigma, Betas = Betas, rho = rho, lambda = lambda,
Tm = Tm, G = G, N = N, p = p, W = W)
--- value of length: 2 type: logical ---
[1] FALSE TRUE
--- function from context ---
function (Sigma, Tm = 1, G, N, Betas, Thetas = NULL, rho = NULL,
lambda = NULL, p = NULL, W = NULL, X = NULL, pdfU = "nvrnorm",
pdfX = "nvrnorm")
{
if (!is.null(W)) {
if (class(W) != "matrix")
W <- as.matrix(W)
rsumW <- rowSums(W)
rsumW[rsumW == 0] <- 1
nW <- dim(W)[1]
W <- W/matrix(rep(rsumW, each = nW), nrow = nW, ncol = nW,
byrow = TRUE)
W <- Matrix::Matrix(W)
}
else W <- Matrix::Diagonal(N)
if (Tm > 1 && G == 1) {
G <- Tm
Tm <- 1
}
if (!is.null(Thetas))
durbin <- TRUE
else durbin <- FALSE
if (!is.null(p) & length(p) == 1)
p <- matrix(p, nrow = G, ncol = 1)
if (is.null(lambda))
lambda <- rep(0, G)
if (is.null(rho))
rho <- rep(0, G)
if (length(lambda) == 1)
lambda <- as.numeric(matrix(lambda, nrow = G, ncol = 1))
if (length(rho) == 1)
rho <- as.numeric(matrix(rho, nrow = G, ncol = 1))
if (is.null(X)) {
if (is.null(p))
stop("Arguments X and p can not be NULL simultaneously")
if (pdfX == "nvrunif") {
X <- cbind(matrix(1, N, 1), matrix(runif(N * (p[1] -
1)), N, (p[1] - 1)))
for (i in 1:(G - 1)) {
X <- Matrix::bdiag(X, cbind(matrix(1, N, 1),
matrix(runif(N * (p[i + 1] - 1)), N, (p[i +
1] - 1))))
}
if (Tm > 1) {
for (i in 1:(Tm - 1)) {
X2 <- cbind(matrix(1, N, 1), matrix(runif(N *
(p[1] - 1)), N, (p[1] - 1)))
for (i in 1:(G - 1)) {
X2 <- Matrix::bdiag(X2, cbind(matrix(1, N,
1), matrix(runif(N * (p[i + 1] - 1)), N,
(p[i + 1] - 1))))
}
X <- rbind(X, X2)
}
}
}
else if (pdfX == "nvrnorm") {
X <- cbind(matrix(1, N, 1), matrix(rnorm(N * (p[1] -
1), 0, 1), N, (p[1] - 1)))
for (i in 1:(G - 1)) {
X <- Matrix::bdiag(X, cbind(matrix(1, N, 1),
matrix(rnorm(N * (p[i + 1] - 1), 0, 1), N,
(p[i + 1] - 1))))
}
if (Tm > 1) {
for (i in 1:(Tm - 1)) {
X2 <- cbind(matrix(1, N, 1), matrix(rnorm(N *
(p[1] - 1), 0, 1), N, (p[1] - 1)))
for (i in 1:(G - 1)) {
X2 <- Matrix::bdiag(X2, cbind(matrix(1, N,
1), matrix(rnorm(N * (p[i + 1] - 1), 0,
1), N, (p[i + 1] - 1))))
}
X <- rbind(X, X2)
}
}
}
else stop("pdfX only can be nvrnorm or nvrunif")
nam <- c(paste0("Intercep_", 1), paste(paste0("X", 1,
"_"), 1:(p[1] - 1), sep = ""))
if (length(p > 1)) {
for (i in 2:(length(p))) {
nam <- c(nam, c(paste0("Intercep_", i), paste(paste0("X",
i, "_"), 1:(p[i] - 1), sep = "")))
}
}
dimnames(X)[[2]] <- nam
}
if (is.null(p)) {
if ((ncol(X)%%G) != 0)
stop("Argument p need to be set")
p <- rep(ncol(X)/G, G)
}
IT <- Matrix::Diagonal(Tm)
IR <- Matrix::Diagonal(N)
IG <- Matrix::Diagonal(G)
IGR <- Matrix::Diagonal(G * N)
if (durbin) {
WX <- (IT %x% IG %x% W) %*% X
dimnames(WX)[[2]] <- paste0("W_", colnames(X))
Xdurbin <- NULL
pdurbin <- p - 1
for (i in 1:length(p)) {
if (i == 1) {
Xdurbin <- cbind(X[, 1:p[i]], WX[, 2:p[i]])
Coeff <- c(Betas[1:p[1]], Thetas[1:pdurbin[1]])
}
else {
Xdurbin <- cbind(Xdurbin, X[, (cumsum(p)[i -
1] + 1):cumsum(p)[i]], WX[, (cumsum(p)[i -
1] + 2):cumsum(p)[i]])
Coeff <- c(Coeff, Betas[(cumsum(p)[i - 1] + 1):cumsum(p)[i]],
Thetas[(cumsum(pdurbin)[i - 1] + 1):cumsum(pdurbin)[i]])
}
}
}
S <- Sigma
OME <- (IT %x% S) %x% IR
chol_OME <- Matrix::Cholesky(OME)
M <- Matrix::Matrix(0, ncol = 1, nrow = Tm * G * N)
U <- matrix(sparseMVN::rmvn.sparse(n = 1, mu = M, CH = chol_OME,
prec = FALSE), ncol = 1)
U <- Matrix::Matrix(U)
if (pdfU == "lognvrnorm")
U <- exp(U)
if (pdfU != "lognvrnorm" && pdfU != "nvrnorm")
print(" Improper pdf. The errors will be drawn from a multivariate Normal ")
IBU <- Matrix::solve(IT %x% (IGR - diag(rho) %x% W), U)
if (durbin) {
Y <- Matrix::solve(IT %x% (IGR - diag(lambda) %x% W),
(Xdurbin %*% Coeff + IBU))
}
else {
Y <- Matrix::solve(IT %x% (IGR - diag(lambda) %x% W),
(X %*% Betas + IBU))
}
results <- list(X = as.matrix(X), Y = as.matrix(Y))
}
<bytecode: 0x55f2495c7f20>
<environment: namespace:spsur>
--- function search by body ---
Function dgp_spsur in namespace spsur has this body.
----------- END OF FAILURE REPORT --------------
Fatal error: the condition has length > 1
Flavor: r-devel-linux-x86_64-debian-gcc
Version: 1.0.0.3
Check: re-building of vignette outputs
Result: WARN
Error(s) in re-building vignettes:
...
--- re-building ‘spsur-vignette.Rmd’ using rmarkdown
----------- FAILURE REPORT --------------
--- failure: the condition has length > 1 ---
--- srcref ---
:
--- package (from environment) ---
spsur
--- call from context ---
lmtestspsur(Form = spcformula, data = spc, W = Wspc)
--- call from argument ---
if (class(W) != "matrix") W <- as.matrix(W)
--- R stacktrace ---
where 1: lmtestspsur(Form = spcformula, data = spc, W = Wspc)
where 2: eval(expr, envir, enclos)
where 3: eval(expr, envir, enclos)
where 4: withVisible(eval(expr, envir, enclos))
where 5: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler,
error = eHandler, message = mHandler)
where 6: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir,
enclos)), warning = wHandler, error = eHandler, message = mHandler))
where 7: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr,
envir, enclos)), warning = wHandler, error = eHandler, message = mHandler)))
where 8: 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 9: evaluate::evaluate(...)
where 10: 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 11: 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 12: block_exec(params)
where 13: call_block(x)
where 14: process_group.block(group)
where 15: process_group(group)
where 16: 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 17: process_file(text, output)
where 18: knitr::knit(knit_input, knit_output, envir = envir, quiet = quiet,
encoding = encoding)
where 19: rmarkdown::render(file, encoding = encoding, quiet = quiet, envir = globalenv(),
...)
where 20: vweave_rmarkdown(...)
where 21: engine$weave(file, quiet = quiet, encoding = enc)
where 22: doTryCatch(return(expr), name, parentenv, handler)
where 23: tryCatchOne(expr, names, parentenv, handlers[[1L]])
where 24: tryCatchList(expr, classes, parentenv, handlers)
where 25: 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 26: tools:::buildVignettes(dir = "/home/hornik/tmp/R.check/r-devel-gcc/Work/PKGS/spsur.Rcheck/vign_test/spsur",
ser_elibs = "/home/hornik/tmp/scratch/Rtmpf7WdWV/file20f21c48c405.rds")
--- value of length: 2 type: logical ---
[1] FALSE TRUE
--- function from context ---
function (Form = NULL, data = NULL, W = NULL, X = NULL, Y = NULL,
time = NULL, G = NULL, N = NULL, Tm = NULL, print_table = TRUE)
{
if (is.null(W))
stop("W matrix is needed")
if (!is.null(W)) {
if (class(W) != "matrix")
W <- as.matrix(W)
rsumW <- rowSums(W)
rsumW[rsumW == 0] <- 1
nW <- dim(W)[1]
W <- W/matrix(rep(rsumW, each = nW), nrow = nW, ncol = nW,
byrow = TRUE)
W <- Matrix::Matrix(W)
}
if (is.null(time)) {
if (!is.null(Form) && !is.null(data)) {
if (!any(class(Form) == "Formula"))
Form <- Formula::Formula(Form)
get_XY <- get_data_spsur(formula = Form, data = data,
W = W)
Y <- get_XY$Y
X <- get_XY$X
G <- get_XY$G
N <- get_XY$N
Tm <- get_XY$Tm
p <- get_XY$p
rm(get_XY)
}
else {
if (G == 1 && Tm > 1) {
G <- Tm
Tm <- 1
}
}
}
else {
if (class(time) != "factor")
time <- as.factor(time)
time <- droplevels(time)
if (length(time) != nrow(data))
stop("time must have same length than the\n number of rows in data")
mt <- terms(Form)
G <- length(levels(time))
Ylist <- vector("list", G)
Xlist <- vector("list", G)
p <- NULL
namesX <- NULL
levels_time <- levels(time)
for (i in 1:G) {
data_i <- model.frame(mt, data = data[time == levels_time[i],
])
Ylist[[i]] <- data_i[, 1]
Xlist[[i]] <- model.matrix(mt, data = data[time ==
levels_time[i], ])
p <- c(p, ncol(Xlist[[i]]))
namesX <- c(namesX, paste(colnames(Xlist[[i]]), i,
sep = "_"))
}
Y <- matrix(unlist(Ylist), ncol = 1)
X <- as.matrix(Matrix::bdiag(Xlist))
colnames(X) <- namesX
N <- length(Ylist[[1]])
Tm <- 1
}
res <- sur3_spdiag(Tm = Tm, G = G, N = N, Y = Y, X = X, W = W)
table_results <- cbind(res$stat, res$df, pchisq(res$stat,
res$df, lower.tail = FALSE))
rownames(table_results) <- res$stat_names
colnames(table_results) <- c("LM-Stat.", "DF", "p-value")
if (print_table)
printCoefmat(table_results, P.values = TRUE, has.Pvalue = TRUE,
digits = 4)
return(res)
}
<bytecode: 0x5618e0825c88>
<environment: namespace:spsur>
--- function search by body ---
Function lmtestspsur in namespace spsur has this body.
----------- END OF FAILURE REPORT --------------
Fatal error: the condition has length > 1
Flavor: r-devel-linux-x86_64-debian-gcc