Error(s) in re-building vignettes:
  ...
--- re-building 'Area_Analysis.Rmd' using rmarkdown
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
spsurvey
 --- call from context --- 
localmean.weight(x, y, 1/wgt)
 --- call from argument --- 
while (ind & iter < 11) {
    v <- v + vincr
    xt <- x + rnorm(n, 0, v)
    yt <- y + rnorm(n, 0, v)
    a22 <- localmean.weight2(xt, yt, prb, nbh)
    ind <- class(a22) == "try-error"
    iter <- iter + 1
}
 --- R stacktrace ---
where 1: localmean.weight(x, y, 1/wgt)
where 2: catvar.prop(z, w, x, y, prop, stratum.ind, NULL, cluster.ind, 
    pcfactor.ind = pcfactor.ind, pcfsize = pcfsize, support = support, 
    vartype = vartype, warn.ind = warn.ind, warn.df = warn.df, 
    warn.vec = warn.vec)
where 3: category.est(catvar = data.cat[subpop.ind, ivar], wgt = design[subpop.ind, 
    2], x = design[subpop.ind, 3], y = design[subpop.ind, 4], 
    stratum = design[subpop.ind, 5], cluster = design[subpop.ind, 
        6], wgt1 = design[subpop.ind, 7], x1 = design[subpop.ind, 
        8], y1 = design[subpop.ind, 9], popsize = temp.popsize, 
    popcorrect = pcfactor.ind, pcfsize = temp.pcfsize, N.cluster = temp.N.cluster, 
    stage1size = temp.stage1size, support = design[subpop.ind, 
        10], sizeweight = swgt.ind, swgt = design[subpop.ind, 
        11], swgt1 = design[subpop.ind, 12], vartype = vartype, 
    conf = conf, check.ind = FALSE, warn.ind = warn.ind, warn.df = warn.df, 
    warn.vec = c(typenames[itype], subpopnames[isubpop], varnames[ivar]))
where 4: cat.analysis(sites, subpop, design, data.cat)
where 5: eval(expr, envir, enclos)
where 6: eval(expr, envir, enclos)
where 7: withVisible(eval(expr, envir, enclos))
where 8: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler, 
    error = eHandler, message = mHandler)
where 9: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir, 
    enclos)), warning = wHandler, error = eHandler, message = mHandler))
where 10: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr, 
    envir, enclos)), warning = wHandler, error = eHandler, message = mHandler)))
where 11: 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 12: evaluate::evaluate(...)
where 13: 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 14: 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 15: block_exec(params)
where 16: call_block(x)
where 17: process_group.block(group)
where 18: process_group(group)
where 19: 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 20: process_file(text, output)
where 21: knitr::knit(knit_input, knit_output, envir = envir, quiet = quiet)
where 22: rmarkdown::render(file, encoding = encoding, quiet = quiet, envir = globalenv(), 
    ...)
where 23: vweave_rmarkdown(...)
where 24: engine$weave(file, quiet = quiet, encoding = enc)
where 25: doTryCatch(return(expr), name, parentenv, handler)
where 26: tryCatchOne(expr, names, parentenv, handlers[[1L]])
where 27: tryCatchList(expr, classes, parentenv, handlers)
where 28: 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 29: tools:::.buildOneVignette("Area_Analysis.Rmd", "/home/hornik/tmp/R.check/r-devel-clang/Work/PKGS/spsurvey.Rcheck/vign_test/spsurvey", 
    TRUE, FALSE, "Area_Analysis", "UTF-8", "/tmp/Rtmp0xsaKx/file248673d9aae1.rds")

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (x, y, prb, nbh = 4, vincr = 1e-05 * abs(mean(y))) 
{
    n <- length(x)
    dst <- as.matrix(dist(cbind(x, y), diag = TRUE, upper = TRUE))
    idx <- apply(dst, 2, order)[1:nbh, ]
    jdx <- rep(1:n, rep(nbh, n))
    kdx <- unique(c((jdx - 1) * n + idx, (idx - 1) * n + jdx)) - 
        1
    ij <- cbind((kdx)%/%n + 1, (kdx)%%n + 1)
    ij <- ij[order(ij[, 1], dst[ij]), ]
    gct <- tabulate(ij[, 1])
    gwt <- numeric(0)
    for (i in 1:n) gwt <- c(gwt, 1 - (1:gct[i] - 1)/(gct[i]))
    gwt <- gwt/prb[ij[, 2]]
    smwt <- sapply(split(gwt, ij[, 1]), sum)
    gwt <- gwt/smwt[ij[, 1]]
    smwt <- sapply(split(gwt, ij[, 2]), sum)
    hij <- matrix(0, n, n)
    hij[ij] <- 0.5
    a22 <- try(ginv(diag(gct/2) - hij %*% diag(2/gct) %*% hij), 
        TRUE)
    ind <- class(a22) == "try-error"
    iter <- 1
    v <- 0
    while (ind & iter < 11) {
        v <- v + vincr
        xt <- x + rnorm(n, 0, v)
        yt <- y + rnorm(n, 0, v)
        a22 <- localmean.weight2(xt, yt, prb, nbh)
        ind <- class(a22) == "try-error"
        iter <- iter + 1
    }
    if (ind) 
        stop("\nThe La.svd function terminated with an error.  Add random noise to the \nx-coordinates and y-coordinates.")
    a21 <- -diag(2/gct) %*% hij %*% a22
    lm <- a21 %*% (1 - smwt)
    gm <- a22 %*% (1 - smwt)
    gwt <- (lm[ij[, 1]] + gm[ij[, 2]])/2 + gwt
    list(ij = ij, gwt = gwt)
}
<bytecode: 0x8d78e28>
<environment: namespace:spsurvey>
 --- function search by body ---
Function localmean.weight in namespace spsurvey has this body.
 ----------- END OF FAILURE REPORT -------------- 
Quitting from lines 94-95 (Area_Analysis.Rmd) 
Error: processing vignette 'Area_Analysis.Rmd' failed with diagnostics:
the condition has length > 1
--- failed re-building 'Area_Analysis.Rmd'

--- re-building 'Area_Design.Rmd' using rmarkdown
--- finished re-building 'Area_Design.Rmd'

--- re-building 'CDF_Analysis.Rmd' using rmarkdown
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
spsurvey
 --- call from context --- 
localmean.weight(x, y, 1/wgt)
 --- call from argument --- 
while (ind & iter < 11) {
    v <- v + vincr
    xt <- x + rnorm(n, 0, v)
    yt <- y + rnorm(n, 0, v)
    a22 <- localmean.weight2(xt, yt, prb, nbh)
    ind <- class(a22) == "try-error"
    iter <- iter + 1
}
 --- R stacktrace ---
where 1: localmean.weight(x, y, 1/wgt)
where 2: cdfvar.prop(z, wgt, x, y, cdfval, cdfest.p, stratum.ind, NULL, 
    cluster.ind, cluster, wgt1, x1, y1, pcfactor.ind, pcfsize, 
    N.cluster, stage1size, support, vartype, warn.ind, warn.df, 
    warn.vec)
where 3: cdf.est(z = data.cont[subpop.ind, ivar], wgt = design[subpop.ind, 
    2], x = design[subpop.ind, 3], y = design[subpop.ind, 4], 
    stratum = design[subpop.ind, 5], cluster = design[subpop.ind, 
        6], wgt1 = design[subpop.ind, 7], x1 = design[subpop.ind, 
        8], y1 = design[subpop.ind, 9], popsize = temp.popsize, 
    popcorrect = pcfactor.ind, pcfsize = temp.pcfsize, N.cluster = temp.N.cluster, 
    stage1size = temp.stage1size, support = design[subpop.ind, 
        10], sizeweight = swgt.ind, swgt = design[subpop.ind, 
        11], swgt1 = design[subpop.ind, 12], vartype = vartype, 
    conf = conf, cdfval = cdfval, pctval = pctval, check.ind = FALSE, 
    warn.ind = warn.ind, warn.df = warn.df, warn.vec = warn.vec)
where 4: cont.analysis(sites, subpop, design, data.cont, popsize = list(Basin = as.list(framesize)))
where 5: eval(expr, envir, enclos)
where 6: eval(expr, envir, enclos)
where 7: withVisible(eval(expr, envir, enclos))
where 8: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler, 
    error = eHandler, message = mHandler)
where 9: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir, 
    enclos)), warning = wHandler, error = eHandler, message = mHandler))
where 10: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr, 
    envir, enclos)), warning = wHandler, error = eHandler, message = mHandler)))
where 11: 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 12: evaluate::evaluate(...)
where 13: 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 14: 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 15: block_exec(params)
where 16: call_block(x)
where 17: process_group.block(group)
where 18: process_group(group)
where 19: 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 20: process_file(text, output)
where 21: knitr::knit(knit_input, knit_output, envir = envir, quiet = quiet)
where 22: rmarkdown::render(file, encoding = encoding, quiet = quiet, envir = globalenv(), 
    ...)
where 23: vweave_rmarkdown(...)
where 24: engine$weave(file, quiet = quiet, encoding = enc)
where 25: doTryCatch(return(expr), name, parentenv, handler)
where 26: tryCatchOne(expr, names, parentenv, handlers[[1L]])
where 27: tryCatchList(expr, classes, parentenv, handlers)
where 28: 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 29: tools:::.buildOneVignette("CDF_Analysis.Rmd", "/home/hornik/tmp/R.check/r-devel-clang/Work/PKGS/spsurvey.Rcheck/vign_test/spsurvey", 
    TRUE, FALSE, "CDF_Analysis", "UTF-8", "/tmp/Rtmp0xsaKx/file24867cbda449.rds")

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (x, y, prb, nbh = 4, vincr = 1e-05 * abs(mean(y))) 
{
    n <- length(x)
    dst <- as.matrix(dist(cbind(x, y), diag = TRUE, upper = TRUE))
    idx <- apply(dst, 2, order)[1:nbh, ]
    jdx <- rep(1:n, rep(nbh, n))
    kdx <- unique(c((jdx - 1) * n + idx, (idx - 1) * n + jdx)) - 
        1
    ij <- cbind((kdx)%/%n + 1, (kdx)%%n + 1)
    ij <- ij[order(ij[, 1], dst[ij]), ]
    gct <- tabulate(ij[, 1])
    gwt <- numeric(0)
    for (i in 1:n) gwt <- c(gwt, 1 - (1:gct[i] - 1)/(gct[i]))
    gwt <- gwt/prb[ij[, 2]]
    smwt <- sapply(split(gwt, ij[, 1]), sum)
    gwt <- gwt/smwt[ij[, 1]]
    smwt <- sapply(split(gwt, ij[, 2]), sum)
    hij <- matrix(0, n, n)
    hij[ij] <- 0.5
    a22 <- try(ginv(diag(gct/2) - hij %*% diag(2/gct) %*% hij), 
        TRUE)
    ind <- class(a22) == "try-error"
    iter <- 1
    v <- 0
    while (ind & iter < 11) {
        v <- v + vincr
        xt <- x + rnorm(n, 0, v)
        yt <- y + rnorm(n, 0, v)
        a22 <- localmean.weight2(xt, yt, prb, nbh)
        ind <- class(a22) == "try-error"
        iter <- iter + 1
    }
    if (ind) 
        stop("\nThe La.svd function terminated with an error.  Add random noise to the \nx-coordinates and y-coordinates.")
    a21 <- -diag(2/gct) %*% hij %*% a22
    lm <- a21 %*% (1 - smwt)
    gm <- a22 %*% (1 - smwt)
    gwt <- (lm[ij[, 1]] + gm[ij[, 2]])/2 + gwt
    list(ij = ij, gwt = gwt)
}
<bytecode: 0xb2bc8c8>
<environment: namespace:spsurvey>
 --- function search by body ---
Function localmean.weight in namespace spsurvey has this body.
 ----------- END OF FAILURE REPORT -------------- 
Quitting from lines 102-104 (CDF_Analysis.Rmd) 
Error: processing vignette 'CDF_Analysis.Rmd' failed with diagnostics:
the condition has length > 1
--- failed re-building 'CDF_Analysis.Rmd'

--- re-building 'CDF_Deconvolution.Rmd' using rmarkdown
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
spsurvey
 --- call from context --- 
localmean.weight(x, y, 1/wgt)
 --- call from argument --- 
while (ind & iter < 11) {
    v <- v + vincr
    xt <- x + rnorm(n, 0, v)
    yt <- y + rnorm(n, 0, v)
    a22 <- localmean.weight2(xt, yt, prb, nbh)
    ind <- class(a22) == "try-error"
    iter <- iter + 1
}
 --- R stacktrace ---
where 1: localmean.weight(x, y, 1/wgt)
where 2: cdfvar.prop(z, wgt, x, y, cdfval, cdfest.p, stratum.ind, NULL, 
    cluster.ind, cluster, wgt1, x1, y1, pcfactor.ind, pcfsize, 
    N.cluster, stage1size, support, vartype, warn.ind, warn.df, 
    warn.vec)
where 3: cdf.est(z = decon_data$Richness, wgt = rep(1, nr), x = decon_data$xcoord, 
    y = decon_data$ycoord, cdfval = cdfvals)
where 4: eval(expr, envir, enclos)
where 5: eval(expr, envir, enclos)
where 6: withVisible(eval(expr, envir, enclos))
where 7: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler, 
    error = eHandler, message = mHandler)
where 8: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir, 
    enclos)), warning = wHandler, error = eHandler, message = mHandler))
where 9: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr, 
    envir, enclos)), warning = wHandler, error = eHandler, message = mHandler)))
where 10: 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 11: evaluate::evaluate(...)
where 12: 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 13: 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 14: block_exec(params)
where 15: call_block(x)
where 16: process_group.block(group)
where 17: process_group(group)
where 18: 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 19: process_file(text, output)
where 20: knitr::knit(knit_input, knit_output, envir = envir, quiet = quiet)
where 21: rmarkdown::render(file, encoding = encoding, quiet = quiet, envir = globalenv(), 
    ...)
where 22: vweave_rmarkdown(...)
where 23: engine$weave(file, quiet = quiet, encoding = enc)
where 24: doTryCatch(return(expr), name, parentenv, handler)
where 25: tryCatchOne(expr, names, parentenv, handlers[[1L]])
where 26: tryCatchList(expr, classes, parentenv, handlers)
where 27: 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 28: tools:::.buildOneVignette("CDF_Deconvolution.Rmd", "/home/hornik/tmp/R.check/r-devel-clang/Work/PKGS/spsurvey.Rcheck/vign_test/spsurvey", 
    TRUE, FALSE, "CDF_Deconvolution", "UTF-8", "/tmp/Rtmp0xsaKx/file248623c80d1.rds")

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (x, y, prb, nbh = 4, vincr = 1e-05 * abs(mean(y))) 
{
    n <- length(x)
    dst <- as.matrix(dist(cbind(x, y), diag = TRUE, upper = TRUE))
    idx <- apply(dst, 2, order)[1:nbh, ]
    jdx <- rep(1:n, rep(nbh, n))
    kdx <- unique(c((jdx - 1) * n + idx, (idx - 1) * n + jdx)) - 
        1
    ij <- cbind((kdx)%/%n + 1, (kdx)%%n + 1)
    ij <- ij[order(ij[, 1], dst[ij]), ]
    gct <- tabulate(ij[, 1])
    gwt <- numeric(0)
    for (i in 1:n) gwt <- c(gwt, 1 - (1:gct[i] - 1)/(gct[i]))
    gwt <- gwt/prb[ij[, 2]]
    smwt <- sapply(split(gwt, ij[, 1]), sum)
    gwt <- gwt/smwt[ij[, 1]]
    smwt <- sapply(split(gwt, ij[, 2]), sum)
    hij <- matrix(0, n, n)
    hij[ij] <- 0.5
    a22 <- try(ginv(diag(gct/2) - hij %*% diag(2/gct) %*% hij), 
        TRUE)
    ind <- class(a22) == "try-error"
    iter <- 1
    v <- 0
    while (ind & iter < 11) {
        v <- v + vincr
        xt <- x + rnorm(n, 0, v)
        yt <- y + rnorm(n, 0, v)
        a22 <- localmean.weight2(xt, yt, prb, nbh)
        ind <- class(a22) == "try-error"
        iter <- iter + 1
    }
    if (ind) 
        stop("\nThe La.svd function terminated with an error.  Add random noise to the \nx-coordinates and y-coordinates.")
    a21 <- -diag(2/gct) %*% hij %*% a22
    lm <- a21 %*% (1 - smwt)
    gm <- a22 %*% (1 - smwt)
    gwt <- (lm[ij[, 1]] + gm[ij[, 2]])/2 + gwt
    list(ij = ij, gwt = gwt)
}
<bytecode: 0x77f47c0>
<environment: namespace:spsurvey>
 --- function search by body ---
Function localmean.weight in namespace spsurvey has this body.
 ----------- END OF FAILURE REPORT -------------- 
Quitting from lines 72-77 (CDF_Deconvolution.Rmd) 
Error: processing vignette 'CDF_Deconvolution.Rmd' failed with diagnostics:
the condition has length > 1
--- failed re-building 'CDF_Deconvolution.Rmd'

--- re-building 'Change_Analysis.Rmd' using rmarkdown
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
spsurvey
 --- call from context --- 
localmean.weight(x, y, 1/wgt)
 --- call from argument --- 
while (ind & iter < 11) {
    v <- v + vincr
    xt <- x + rnorm(n, 0, v)
    yt <- y + rnorm(n, 0, v)
    a22 <- localmean.weight2(xt, yt, prb, nbh)
    ind <- class(a22) == "try-error"
    iter <- iter + 1
}
 --- R stacktrace ---
where 1: localmean.weight(x, y, 1/wgt)
where 2: catvar.prop(z, w, x, y, prop, stratum.ind, NULL, cluster.ind, 
    pcfactor.ind = pcfactor.ind, pcfsize = pcfsize, support = support, 
    vartype = vartype, warn.ind = warn.ind, warn.df = warn.df, 
    warn.vec = warn.vec)
where 3: category.est(catvar = z_1, wgt = wgt_1, x = x_1, y = y_1, stratum = stratum_1, 
    cluster = cluster_1, wgt1 = wgt1_1, x1 = x1_1, y1 = y1_1, 
    popsize = popsize_1, popcorrect = popcorrect_1, pcfsize = pcfsize_1, 
    N.cluster = N.cluster_1, stage1size = stage1size_1, support = support_1, 
    sizeweight = sizeweight_1, swgt = swgt_1, swgt1 = swgt1_1, 
    vartype = vartype_1, conf = conf, check.ind = check.ind, 
    warn.ind = warn.ind, warn.df = warn.df, warn.vec = warn.vec)
where 4: change.est(resp.ind = "cat", z_1 = data.cat_1[subpop.ind_1, ivar], 
    wgt_1 = design_1[subpop.ind_1, 2], x_1 = design_1[subpop.ind_1, 
        3], y_1 = design_1[subpop.ind_1, 4], repeat_1 = repeat.ind_1, 
    z_2 = data.cat_2[subpop.ind_2, ivar], wgt_2 = design_2[subpop.ind_2, 
        2], x_2 = design_2[subpop.ind_2, 3], y_2 = design_2[subpop.ind_2, 
        4], repeat_2 = repeat.ind_2, revisitwgt = revisitwgt, 
    stratum_1 = design_1[subpop.ind_1, 5], stratum_2 = design_2[subpop.ind_2, 
        5], cluster_1 = design_1[subpop.ind_1, 6], cluster_2 = design_2[subpop.ind_2, 
        6], wgt1_1 = design_1[subpop.ind_1, 7], x1_1 = design_1[subpop.ind_1, 
        8], y1_1 = design_1[subpop.ind_1, 9], wgt1_2 = design_2[subpop.ind_2, 
        7], x1_2 = design_2[subpop.ind_2, 8], y1_2 = design_2[subpop.ind_2, 
        9], popsize_1 = temp.popsize_1, popsize_2 = temp.popsize_2, 
    popcorrect_1 = pcfactor.ind_1, pcfsize_1 = temp.pcfsize_1, 
    N.cluster_1 = temp.N.cluster_1, stage1size_1 = temp.stage1size_1, 
    support_1 = design_1[subpop.ind_1, 10], popcorrect_2 = pcfactor.ind_2, 
    pcfsize_2 = temp.pcfsize_2, N.cluster_2 = temp.N.cluster_2, 
    stage1size_2 = temp.stage1size_2, support_2 = design_2[subpop.ind_2, 
        10], sizeweight_1 = swgt.ind_1, swgt_1 = design_1[subpop.ind_1, 
        11], swgt1_1 = design_1[subpop.ind_1, 12], sizeweight_2 = swgt.ind_2, 
    swgt_2 = design_2[subpop.ind_1, 11], swgt1_2 = design_2[subpop.ind_1, 
        12], vartype_1 = vartype_1, vartype_2 = vartype_2, conf = conf, 
    check.ind = FALSE, warn.ind = warn.ind, warn.df = warn.df, 
    warn.vec = c(typenames[itype], subpopnames[isubpop], varnames[ivar]))
where 5: change.analysis(sites, repeats, subpop, design, data.cat, data.cont, 
    test = c("mean", "median"))
where 6: eval(expr, envir, enclos)
where 7: eval(expr, envir, enclos)
where 8: withVisible(eval(expr, envir, enclos))
where 9: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler, 
    error = eHandler, message = mHandler)
where 10: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir, 
    enclos)), warning = wHandler, error = eHandler, message = mHandler))
where 11: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr, 
    envir, enclos)), warning = wHandler, error = eHandler, message = mHandler)))
where 12: 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 13: evaluate::evaluate(...)
where 14: 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 15: 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 16: block_exec(params)
where 17: call_block(x)
where 18: process_group.block(group)
where 19: process_group(group)
where 20: 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 21: process_file(text, output)
where 22: knitr::knit(knit_input, knit_output, envir = envir, quiet = quiet)
where 23: rmarkdown::render(file, encoding = encoding, quiet = quiet, envir = globalenv(), 
    ...)
where 24: vweave_rmarkdown(...)
where 25: engine$weave(file, quiet = quiet, encoding = enc)
where 26: doTryCatch(return(expr), name, parentenv, handler)
where 27: tryCatchOne(expr, names, parentenv, handlers[[1L]])
where 28: tryCatchList(expr, classes, parentenv, handlers)
where 29: 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 30: tools:::.buildOneVignette("Change_Analysis.Rmd", "/home/hornik/tmp/R.check/r-devel-clang/Work/PKGS/spsurvey.Rcheck/vign_test/spsurvey", 
    TRUE, FALSE, "Change_Analysis", "UTF-8", "/tmp/Rtmp0xsaKx/file24865a75857a.rds")

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (x, y, prb, nbh = 4, vincr = 1e-05 * abs(mean(y))) 
{
    n <- length(x)
    dst <- as.matrix(dist(cbind(x, y), diag = TRUE, upper = TRUE))
    idx <- apply(dst, 2, order)[1:nbh, ]
    jdx <- rep(1:n, rep(nbh, n))
    kdx <- unique(c((jdx - 1) * n + idx, (idx - 1) * n + jdx)) - 
        1
    ij <- cbind((kdx)%/%n + 1, (kdx)%%n + 1)
    ij <- ij[order(ij[, 1], dst[ij]), ]
    gct <- tabulate(ij[, 1])
    gwt <- numeric(0)
    for (i in 1:n) gwt <- c(gwt, 1 - (1:gct[i] - 1)/(gct[i]))
    gwt <- gwt/prb[ij[, 2]]
    smwt <- sapply(split(gwt, ij[, 1]), sum)
    gwt <- gwt/smwt[ij[, 1]]
    smwt <- sapply(split(gwt, ij[, 2]), sum)
    hij <- matrix(0, n, n)
    hij[ij] <- 0.5
    a22 <- try(ginv(diag(gct/2) - hij %*% diag(2/gct) %*% hij), 
        TRUE)
    ind <- class(a22) == "try-error"
    iter <- 1
    v <- 0
    while (ind & iter < 11) {
        v <- v + vincr
        xt <- x + rnorm(n, 0, v)
        yt <- y + rnorm(n, 0, v)
        a22 <- localmean.weight2(xt, yt, prb, nbh)
        ind <- class(a22) == "try-error"
        iter <- iter + 1
    }
    if (ind) 
        stop("\nThe La.svd function terminated with an error.  Add random noise to the \nx-coordinates and y-coordinates.")
    a21 <- -diag(2/gct) %*% hij %*% a22
    lm <- a21 %*% (1 - smwt)
    gm <- a22 %*% (1 - smwt)
    gwt <- (lm[ij[, 1]] + gm[ij[, 2]])/2 + gwt
    list(ij = ij, gwt = gwt)
}
<bytecode: 0xb3d42c0>
<environment: namespace:spsurvey>
 --- function search by body ---
Function localmean.weight in namespace spsurvey has this body.
 ----------- END OF FAILURE REPORT -------------- 
Quitting from lines 118-121 (Change_Analysis.Rmd) 
Error: processing vignette 'Change_Analysis.Rmd' failed with diagnostics:
the condition has length > 1
--- failed re-building 'Change_Analysis.Rmd'

--- re-building 'Finite_Analysis.Rmd' using rmarkdown
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
spsurvey
 --- call from context --- 
localmean.weight(x, y, 1/wgt)
 --- call from argument --- 
while (ind & iter < 11) {
    v <- v + vincr
    xt <- x + rnorm(n, 0, v)
    yt <- y + rnorm(n, 0, v)
    a22 <- localmean.weight2(xt, yt, prb, nbh)
    ind <- class(a22) == "try-error"
    iter <- iter + 1
}
 --- R stacktrace ---
where 1: localmean.weight(x, y, 1/wgt)
where 2: catvar.prop(z, w, x, y, prop, stratum.ind, NULL, cluster.ind, 
    pcfactor.ind = pcfactor.ind, pcfsize = pcfsize, support = support, 
    vartype = vartype, warn.ind = warn.ind, warn.df = warn.df, 
    warn.vec = warn.vec)
where 3: category.est(catvar = data.cat[subpop.ind, ivar], wgt = design[subpop.ind, 
    2], x = design[subpop.ind, 3], y = design[subpop.ind, 4], 
    stratum = design[subpop.ind, 5], cluster = design[subpop.ind, 
        6], wgt1 = design[subpop.ind, 7], x1 = design[subpop.ind, 
        8], y1 = design[subpop.ind, 9], popsize = temp.popsize, 
    popcorrect = pcfactor.ind, pcfsize = temp.pcfsize, N.cluster = temp.N.cluster, 
    stage1size = temp.stage1size, support = design[subpop.ind, 
        10], sizeweight = swgt.ind, swgt = design[subpop.ind, 
        11], swgt1 = design[subpop.ind, 12], vartype = vartype, 
    conf = conf, check.ind = FALSE, warn.ind = warn.ind, warn.df = warn.df, 
    warn.vec = c(typenames[itype], subpopnames[isubpop], varnames[ivar]))
where 4: cat.analysis(sites, subpop, design, data.cat)
where 5: eval(expr, envir, enclos)
where 6: eval(expr, envir, enclos)
where 7: withVisible(eval(expr, envir, enclos))
where 8: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler, 
    error = eHandler, message = mHandler)
where 9: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir, 
    enclos)), warning = wHandler, error = eHandler, message = mHandler))
where 10: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr, 
    envir, enclos)), warning = wHandler, error = eHandler, message = mHandler)))
where 11: 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 12: evaluate::evaluate(...)
where 13: 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 14: 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 15: block_exec(params)
where 16: call_block(x)
where 17: process_group.block(group)
where 18: process_group(group)
where 19: 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 20: process_file(text, output)
where 21: knitr::knit(knit_input, knit_output, envir = envir, quiet = quiet)
where 22: rmarkdown::render(file, encoding = encoding, quiet = quiet, envir = globalenv(), 
    ...)
where 23: vweave_rmarkdown(...)
where 24: engine$weave(file, quiet = quiet, encoding = enc)
where 25: doTryCatch(return(expr), name, parentenv, handler)
where 26: tryCatchOne(expr, names, parentenv, handlers[[1L]])
where 27: tryCatchList(expr, classes, parentenv, handlers)
where 28: 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 29: tools:::.buildOneVignette("Finite_Analysis.Rmd", "/home/hornik/tmp/R.check/r-devel-clang/Work/PKGS/spsurvey.Rcheck/vign_test/spsurvey", 
    TRUE, FALSE, "Finite_Analysis", "UTF-8", "/tmp/Rtmp0xsaKx/file24867f2c14de.rds")

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (x, y, prb, nbh = 4, vincr = 1e-05 * abs(mean(y))) 
{
    n <- length(x)
    dst <- as.matrix(dist(cbind(x, y), diag = TRUE, upper = TRUE))
    idx <- apply(dst, 2, order)[1:nbh, ]
    jdx <- rep(1:n, rep(nbh, n))
    kdx <- unique(c((jdx - 1) * n + idx, (idx - 1) * n + jdx)) - 
        1
    ij <- cbind((kdx)%/%n + 1, (kdx)%%n + 1)
    ij <- ij[order(ij[, 1], dst[ij]), ]
    gct <- tabulate(ij[, 1])
    gwt <- numeric(0)
    for (i in 1:n) gwt <- c(gwt, 1 - (1:gct[i] - 1)/(gct[i]))
    gwt <- gwt/prb[ij[, 2]]
    smwt <- sapply(split(gwt, ij[, 1]), sum)
    gwt <- gwt/smwt[ij[, 1]]
    smwt <- sapply(split(gwt, ij[, 2]), sum)
    hij <- matrix(0, n, n)
    hij[ij] <- 0.5
    a22 <- try(ginv(diag(gct/2) - hij %*% diag(2/gct) %*% hij), 
        TRUE)
    ind <- class(a22) == "try-error"
    iter <- 1
    v <- 0
    while (ind & iter < 11) {
        v <- v + vincr
        xt <- x + rnorm(n, 0, v)
        yt <- y + rnorm(n, 0, v)
        a22 <- localmean.weight2(xt, yt, prb, nbh)
        ind <- class(a22) == "try-error"
        iter <- iter + 1
    }
    if (ind) 
        stop("\nThe La.svd function terminated with an error.  Add random noise to the \nx-coordinates and y-coordinates.")
    a21 <- -diag(2/gct) %*% hij %*% a22
    lm <- a21 %*% (1 - smwt)
    gm <- a22 %*% (1 - smwt)
    gwt <- (lm[ij[, 1]] + gm[ij[, 2]])/2 + gwt
    list(ij = ij, gwt = gwt)
}
<bytecode: 0xae5bf50>
<environment: namespace:spsurvey>
 --- function search by body ---
Function localmean.weight in namespace spsurvey has this body.
 ----------- END OF FAILURE REPORT -------------- 
Quitting from lines 100-102 (Finite_Analysis.Rmd) 
Error: processing vignette 'Finite_Analysis.Rmd' failed with diagnostics:
the condition has length > 1
--- failed re-building 'Finite_Analysis.Rmd'

--- re-building 'Finite_Design.Rmd' using rmarkdown
--- finished re-building 'Finite_Design.Rmd'

--- re-building 'Linear_Analysis.Rmd' using rmarkdown
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
spsurvey
 --- call from context --- 
localmean.weight(x, y, 1/wgt)
 --- call from argument --- 
while (ind & iter < 11) {
    v <- v + vincr
    xt <- x + rnorm(n, 0, v)
    yt <- y + rnorm(n, 0, v)
    a22 <- localmean.weight2(xt, yt, prb, nbh)
    ind <- class(a22) == "try-error"
    iter <- iter + 1
}
 --- R stacktrace ---
where 1: localmean.weight(x, y, 1/wgt)
where 2: catvar.prop(z, w, x, y, prop, stratum.ind, NULL, cluster.ind, 
    pcfactor.ind = pcfactor.ind, pcfsize = pcfsize, support = support, 
    vartype = vartype, warn.ind = warn.ind, warn.df = warn.df, 
    warn.vec = warn.vec)
where 3: category.est(catvar = data.cat[subpop.ind, ivar], wgt = design[subpop.ind, 
    2], x = design[subpop.ind, 3], y = design[subpop.ind, 4], 
    stratum = design[subpop.ind, 5], cluster = design[subpop.ind, 
        6], wgt1 = design[subpop.ind, 7], x1 = design[subpop.ind, 
        8], y1 = design[subpop.ind, 9], popsize = temp.popsize, 
    popcorrect = pcfactor.ind, pcfsize = temp.pcfsize, N.cluster = temp.N.cluster, 
    stage1size = temp.stage1size, support = design[subpop.ind, 
        10], sizeweight = swgt.ind, swgt = design[subpop.ind, 
        11], swgt1 = design[subpop.ind, 12], vartype = vartype, 
    conf = conf, check.ind = FALSE, warn.ind = warn.ind, warn.df = warn.df, 
    warn.vec = c(typenames[itype], subpopnames[isubpop], varnames[ivar]))
where 4: cat.analysis(sites, subpop, design, data.cat)
where 5: eval(expr, envir, enclos)
where 6: eval(expr, envir, enclos)
where 7: withVisible(eval(expr, envir, enclos))
where 8: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler, 
    error = eHandler, message = mHandler)
where 9: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir, 
    enclos)), warning = wHandler, error = eHandler, message = mHandler))
where 10: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr, 
    envir, enclos)), warning = wHandler, error = eHandler, message = mHandler)))
where 11: 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 12: evaluate::evaluate(...)
where 13: 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 14: 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 15: block_exec(params)
where 16: call_block(x)
where 17: process_group.block(group)
where 18: process_group(group)
where 19: 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 20: process_file(text, output)
where 21: knitr::knit(knit_input, knit_output, envir = envir, quiet = quiet)
where 22: rmarkdown::render(file, encoding = encoding, quiet = quiet, envir = globalenv(), 
    ...)
where 23: vweave_rmarkdown(...)
where 24: engine$weave(file, quiet = quiet, encoding = enc)
where 25: doTryCatch(return(expr), name, parentenv, handler)
where 26: tryCatchOne(expr, names, parentenv, handlers[[1L]])
where 27: tryCatchList(expr, classes, parentenv, handlers)
where 28: 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 29: tools:::.buildOneVignette("Linear_Analysis.Rmd", "/home/hornik/tmp/R.check/r-devel-clang/Work/PKGS/spsurvey.Rcheck/vign_test/spsurvey", 
    TRUE, FALSE, "Linear_Analysis", "UTF-8", "/tmp/Rtmp0xsaKx/file248659288e4d.rds")

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (x, y, prb, nbh = 4, vincr = 1e-05 * abs(mean(y))) 
{
    n <- length(x)
    dst <- as.matrix(dist(cbind(x, y), diag = TRUE, upper = TRUE))
    idx <- apply(dst, 2, order)[1:nbh, ]
    jdx <- rep(1:n, rep(nbh, n))
    kdx <- unique(c((jdx - 1) * n + idx, (idx - 1) * n + jdx)) - 
        1
    ij <- cbind((kdx)%/%n + 1, (kdx)%%n + 1)
    ij <- ij[order(ij[, 1], dst[ij]), ]
    gct <- tabulate(ij[, 1])
    gwt <- numeric(0)
    for (i in 1:n) gwt <- c(gwt, 1 - (1:gct[i] - 1)/(gct[i]))
    gwt <- gwt/prb[ij[, 2]]
    smwt <- sapply(split(gwt, ij[, 1]), sum)
    gwt <- gwt/smwt[ij[, 1]]
    smwt <- sapply(split(gwt, ij[, 2]), sum)
    hij <- matrix(0, n, n)
    hij[ij] <- 0.5
    a22 <- try(ginv(diag(gct/2) - hij %*% diag(2/gct) %*% hij), 
        TRUE)
    ind <- class(a22) == "try-error"
    iter <- 1
    v <- 0
    while (ind & iter < 11) {
        v <- v + vincr
        xt <- x + rnorm(n, 0, v)
        yt <- y + rnorm(n, 0, v)
        a22 <- localmean.weight2(xt, yt, prb, nbh)
        ind <- class(a22) == "try-error"
        iter <- iter + 1
    }
    if (ind) 
        stop("\nThe La.svd function terminated with an error.  Add random noise to the \nx-coordinates and y-coordinates.")
    a21 <- -diag(2/gct) %*% hij %*% a22
    lm <- a21 %*% (1 - smwt)
    gm <- a22 %*% (1 - smwt)
    gwt <- (lm[ij[, 1]] + gm[ij[, 2]])/2 + gwt
    list(ij = ij, gwt = gwt)
}
<bytecode: 0x8db8c30>
<environment: namespace:spsurvey>
 --- function search by body ---
Function localmean.weight in namespace spsurvey has this body.
 ----------- END OF FAILURE REPORT -------------- 
Quitting from lines 102-103 (Linear_Analysis.Rmd) 
Error: processing vignette 'Linear_Analysis.Rmd' failed with diagnostics:
the condition has length > 1
--- failed re-building 'Linear_Analysis.Rmd'

--- re-building 'Linear_Design.Rmd' using rmarkdown
--- finished re-building 'Linear_Design.Rmd'

--- re-building 'Risk_Analysis.Rmd' using rmarkdown
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
spsurvey
 --- call from context --- 
localmean.weight(x = x, y = y, prb = 1/wgt)
 --- call from argument --- 
while (ind & iter < 11) {
    v <- v + vincr
    xt <- x + rnorm(n, 0, v)
    yt <- y + rnorm(n, 0, v)
    a22 <- localmean.weight2(xt, yt, prb, nbh)
    ind <- class(a22) == "try-error"
    iter <- iter + 1
}
 --- R stacktrace ---
where 1: localmean.weight(x = x, y = y, prb = 1/wgt)
where 2: relrisk.var(response, stressor, response.levels, stressor.levels, 
    wgt, xcoord, ycoord, stratum.ind, NULL, cluster.ind, pcfactor.ind = pcfactor.ind, 
    pcfsize = pcfsize, support = support, vartype = vartype, 
    warn.ind = warn.ind, warn.df = warn.df, warn.vec = warn.vec)
where 3: relrisk.est(response = data.rr[subpop.ind, response.var[ivar]], 
    stressor = data.rr[subpop.ind, stressor.var[ivar]], response.levels = response.levels[[ivar]], 
    stressor.levels = stressor.levels[[ivar]], wgt = design[subpop.ind, 
        2], xcoord = design[subpop.ind, 3], ycoord = design[subpop.ind, 
        4], stratum = design[subpop.ind, 5], cluster = design[subpop.ind, 
        6], wgt1 = design[subpop.ind, 7], xcoord1 = design[subpop.ind, 
        8], ycoord1 = design[subpop.ind, 9], popcorrect = pcfactor.ind, 
    pcfsize = temp.pcfsize, N.cluster = temp.N.cluster, stage1size = temp.stage1size, 
    support = design[subpop.ind, 10], sizeweight = swgt.ind, 
    swgt = design[subpop.ind, 11], swgt1 = design[subpop.ind, 
        12], vartype = vartype, conf = conf, check.ind = FALSE, 
    warn.ind = warn.ind, warn.df = warn.df, warn.vec = c(typenames[itype], 
        subpopnames[isubpop], varnames[ivar]))
where 4: relrisk.analysis(sites, subpop, design, data.risk, response.var = rep(resp_vars, 
    each = length(stress_vars)), stressor.var = rep(stress_vars, 
    length(resp_vars)))
where 5: eval(expr, envir, enclos)
where 6: eval(expr, envir, enclos)
where 7: withVisible(eval(expr, envir, enclos))
where 8: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler, 
    error = eHandler, message = mHandler)
where 9: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir, 
    enclos)), warning = wHandler, error = eHandler, message = mHandler))
where 10: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr, 
    envir, enclos)), warning = wHandler, error = eHandler, message = mHandler)))
where 11: 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 12: evaluate::evaluate(...)
where 13: 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 14: 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 15: block_exec(params)
where 16: call_block(x)
where 17: process_group.block(group)
where 18: process_group(group)
where 19: 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 20: process_file(text, output)
where 21: knitr::knit(knit_input, knit_output, envir = envir, quiet = quiet)
where 22: rmarkdown::render(file, encoding = encoding, quiet = quiet, envir = globalenv(), 
    ...)
where 23: vweave_rmarkdown(...)
where 24: engine$weave(file, quiet = quiet, encoding = enc)
where 25: doTryCatch(return(expr), name, parentenv, handler)
where 26: tryCatchOne(expr, names, parentenv, handlers[[1L]])
where 27: tryCatchList(expr, classes, parentenv, handlers)
where 28: 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 29: tools:::.buildOneVignette("Risk_Analysis.Rmd", "/home/hornik/tmp/R.check/r-devel-clang/Work/PKGS/spsurvey.Rcheck/vign_test/spsurvey", 
    TRUE, FALSE, "Risk_Analysis", "UTF-8", "/tmp/Rtmp0xsaKx/file24861131aba6.rds")

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (x, y, prb, nbh = 4, vincr = 1e-05 * abs(mean(y))) 
{
    n <- length(x)
    dst <- as.matrix(dist(cbind(x, y), diag = TRUE, upper = TRUE))
    idx <- apply(dst, 2, order)[1:nbh, ]
    jdx <- rep(1:n, rep(nbh, n))
    kdx <- unique(c((jdx - 1) * n + idx, (idx - 1) * n + jdx)) - 
        1
    ij <- cbind((kdx)%/%n + 1, (kdx)%%n + 1)
    ij <- ij[order(ij[, 1], dst[ij]), ]
    gct <- tabulate(ij[, 1])
    gwt <- numeric(0)
    for (i in 1:n) gwt <- c(gwt, 1 - (1:gct[i] - 1)/(gct[i]))
    gwt <- gwt/prb[ij[, 2]]
    smwt <- sapply(split(gwt, ij[, 1]), sum)
    gwt <- gwt/smwt[ij[, 1]]
    smwt <- sapply(split(gwt, ij[, 2]), sum)
    hij <- matrix(0, n, n)
    hij[ij] <- 0.5
    a22 <- try(ginv(diag(gct/2) - hij %*% diag(2/gct) %*% hij), 
        TRUE)
    ind <- class(a22) == "try-error"
    iter <- 1
    v <- 0
    while (ind & iter < 11) {
        v <- v + vincr
        xt <- x + rnorm(n, 0, v)
        yt <- y + rnorm(n, 0, v)
        a22 <- localmean.weight2(xt, yt, prb, nbh)
        ind <- class(a22) == "try-error"
        iter <- iter + 1
    }
    if (ind) 
        stop("\nThe La.svd function terminated with an error.  Add random noise to the \nx-coordinates and y-coordinates.")
    a21 <- -diag(2/gct) %*% hij %*% a22
    lm <- a21 %*% (1 - smwt)
    gm <- a22 %*% (1 - smwt)
    gwt <- (lm[ij[, 1]] + gm[ij[, 2]])/2 + gwt
    list(ij = ij, gwt = gwt)
}
<bytecode: 0x8606b98>
<environment: namespace:spsurvey>
 --- function search by body ---
Function localmean.weight in namespace spsurvey has this body.
 ----------- END OF FAILURE REPORT -------------- 
Quitting from lines 103-106 (Risk_Analysis.Rmd) 
Error: processing vignette 'Risk_Analysis.Rmd' failed with diagnostics:
the condition has length > 1
--- failed re-building 'Risk_Analysis.Rmd'

SUMMARY: processing the following files failed:
  'Area_Analysis.Rmd' 'CDF_Analysis.Rmd' 'CDF_Deconvolution.Rmd'
  'Change_Analysis.Rmd' 'Finite_Analysis.Rmd' 'Linear_Analysis.Rmd'
  'Risk_Analysis.Rmd'

Error: Vignette re-building failed.
Execution halted