* using log directory ‘/data/gannet/ripley/R/packages/tests-LENGTH1/ycinterextra.Rcheck’ * using R Under development (unstable) (2022-03-20 r81945) * using platform: x86_64-pc-linux-gnu (64-bit) * using session charset: UTF-8 * using option ‘--no-stop-on-test-error’ * checking for file ‘ycinterextra/DESCRIPTION’ ... OK * checking extension type ... Package * this is package ‘ycinterextra’ version ‘0.1’ * 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 whether package ‘ycinterextra’ can be installed ... [5s/15s] OK * checking package directory ... 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 ... NOTE Package in Depends field not imported from: ‘compiler’ These packages need to be imported from (in the NAMESPACE file) for when this namespace is loaded but not attached. * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking R code for possible problems ... [8s/21s] NOTE bootstrapswapcurve: no visible global function definition for ‘ts’ fitted: no visible global function definition for ‘ts’ forwardrates: no visible global function definition for ‘ts’ residuals: no visible global function definition for ‘ts’ tZC_NS: no visible global function definition for ‘cmpfun’ tZC_NS_extra: no visible global function definition for ‘cmpfun’ tZC_SV: no visible global function definition for ‘cmpfun’ tZC_SV_extra: no visible global function definition for ‘cmpfun’ ycextra: no visible global function definition for ‘new’ ycinter: no visible global function definition for ‘new’ ycplot: no visible global function definition for ‘par’ ycplot: no visible global function definition for ‘points’ ycplot: no visible global function definition for ‘abline’ ycplot: no visible global function definition for ‘hist’ ycplot: no visible global function definition for ‘lines’ ycplot: no visible global function definition for ‘density’ ycplot: no visible global function definition for ‘qqnorm’ ycplot: no visible global function definition for ‘qqline’ ycsummary: no visible global function definition for ‘shapiro.test’ ycsummary: no visible global function definition for ‘pf’ Undefined global functions or variables: abline cmpfun density hist lines new par pf points qqline qqnorm shapiro.test ts Consider adding importFrom("graphics", "abline", "hist", "lines", "par", "points") importFrom("methods", "new") importFrom("stats", "density", "pf", "qqline", "qqnorm", "shapiro.test", "ts") to your NAMESPACE file (and ensure that your DESCRIPTION Imports field contains 'methods'). * 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 examples ... ERROR Running examples in ‘ycinterextra-Ex.R’ failed The error most likely occurred in: > ### Name: as.list > ### Title: Conversion to a list > ### Aliases: as.list > ### Keywords: curve extrapolation, interpolation, yield > > ### ** Examples > > # Prices > p <- c(0.9859794,0.9744879,0.9602458,0.9416551,0.9196671,0.8957363,0.8716268,0.8482628, + 0.8255457,0.8034710,0.7819525,0.7612204,0.7416912,0.7237042,0.7072136 + ,0.6922140,0.6785227,0.6660095,0.6546902,0.6441639,0.6343366,0.6250234,0.6162910,0.6080358, + 0.6003302,0.5929791,0.5858711,0.5789852,0.5722068,0.5653231) > > # Observed maturities > u <- 1:30 > > # Output maturities > t <- seq(from = 1, to = 60, by = 0.5) > > # Svensson interpolation > yc <- ycextra(p = p, matsin = u, matsout = t, + method="SV", typeres="prices", UFR = 0.018) ----------- FAILURE REPORT -------------- --- failure: length > 1 in coercion to logical --- --- srcref --- : --- package (from environment) --- mcGlobaloptim --- call from context --- multiStartoptim(objectivefn = OF, lower = c(UFR, -15, -30, -30, 0, 3), upper = c(UFR, 30, 30, 30, 3, 6), method = "nlminb", nbtrials = 300, typerunif = "niederreiterlodisp") --- call from argument --- nbpar != length(upper) || lower > upper --- R stacktrace --- where 1: multiStartoptim(objectivefn = OF, lower = c(UFR, -15, -30, -30, 0, 3), upper = c(UFR, 30, 30, 30, 3, 6), method = "nlminb", nbtrials = 300, typerunif = "niederreiterlodisp") where 2: tZC_SV_extra(p = input_curve, matsin = matsin, matsout = matsout, typeres = typeres, UFR = UFR) where 3: ycExtrapolation(p = p, matsin = matsin, matsout = matsout, method = method, typeres = typeres, UFR = UFR, T_UFR = T_UFR) where 4: setExtrapvalues(y, p = p, matsin = matsin, matsout = matsout, method = method, typeres = typeres, UFR = UFR, T_UFR = T_UFR) where 5: setExtrapvalues(y, p = p, matsin = matsin, matsout = matsout, method = method, typeres = typeres, UFR = UFR, T_UFR = T_UFR) where 6: ycextra(p = p, matsin = u, matsout = t, method = "SV", typeres = "prices", UFR = 0.018) --- value of length: 6 type: logical --- [1] FALSE FALSE FALSE FALSE FALSE FALSE --- function from context --- function (start0 = NULL, objectivefn, gradient = NULL, ..., hessian = NULL, lower = -Inf, upper = Inf, control = list(), method = c("L-BFGS-B", "Nelder-Mead", "nlminb"), nbtrials = NULL, typerunif = c("runifbase", "runifantithetics", "sobol", "torus", "niederreiterlodisp"), localsearch = c("exhaustive", "median"), verb = FALSE, nbclusters = NULL) { if (missing(objectivefn)) stop("Objective function must be provided") nbpar <- length(lower) if (nbpar != length(upper) || lower > upper) stop("parameter lower must be lower than parameter upper componentwise, and they must have the same length") if (missing(method) || !(method %in% c("L-BFGS-B", "Nelder-Mead", "nlminb"))) { warning("optimization method is missing or inadequate, default is set to nlminb") themethod <- "nlminb" } else { themethod <- match.arg(method) } if (missing(nbclusters) || is.null(nbclusters) || nbclusters <= 1) { if (missing(start0) && (missing(nbtrials) || nbtrials <= 0)) stop("When nbtrials is missing or equal to 0, starting parameters 'start0' should be provided") if (missing(nbtrials) || is.null(nbtrials) || nbtrials <= 0) { if (!missing(typerunif)) warning("unused argument typerunif") if (missing(hessian) && themethod %in% c("L-BFGS-B", "Nelder-Mead")) hessian <- FALSE return(call_localoptim(start0 = start0, objectivefn = objectivefn, gradient = gradient, ..., hessian = hessian, lower = lower, upper = upper, control = control, themethod = themethod, nbtrials = nbtrials, verb = verb, cl = NULL)) } else { if (!missing(start0)) warning("starting value is unused when nbtrials is provided") if (missing(typerunif) || !(typerunif %in% c("runifbase", "runifantithetics", "sobol", "torus", "niederreiterlodisp"))) { warning("typerunif is either missing or inadequate, and was set to default 'runifbase'") typerunif <- "runifbase" } else { typerunif <- match.arg(typerunif) } if (!is.finite(lower) || !is.finite(upper)) stop("Both the lower and upper bounds for parameters should be provided and finite") localsearch <- match.arg(localsearch) if (length(localsearch) == 0) localsearch <- "exhaustive" if (localsearch == "exhaustive") { start0 <- rUnif(nbtrials = nbtrials, nbpar = nbpar, lower = lower, upper = upper, method = typerunif) } if (localsearch == "median") { if (nbpar == 1) { U <- rUnif(nbtrials = nbtrials, nbpar = nbpar, lower = lower, upper = upper, method = typerunif) fwU <- objectivefn(U, ...) start0 <- U[fwU < median(fwU)] nbtrials <- length(start0) } else { U <- rUnif(nbtrials = nbtrials, nbpar = nbpar, lower = lower, upper = upper, method = typerunif) fwU <- apply(U, 1, function(x) objectivefn(x, ...)) start0 <- U[fwU < median(fwU), ] nbtrials <- dim(start0)[1] } } if (missing(hessian) && themethod %in% c("L-BFGS-B", "Nelder-Mead")) hessian <- FALSE return(call_localoptim(start0 = start0, objectivefn = objectivefn, gradient = gradient, ..., hessian = hessian, lower = lower, upper = upper, control = control, themethod = themethod, nbtrials = nbtrials, verb = verb, cl = NULL)) } } else { if (nbclusters < 0 || floor(nbclusters) != nbclusters || is.array(nbclusters) || !is.numeric(nbclusters)) stop("nbclusters must be a positive integer") if (missing(lower) || missing(upper)) stop("lower and upper are missing and must be provided") if (!is.finite(lower) || !is.finite(upper)) stop("Both the lower and upper bounds for parameters should be provided and finite") if (verb) warning("argument verb is unused in parallel computation") if (missing(nbtrials) || is.null(nbtrials) || nbtrials <= 0) { warning("nbtrials is not provided (or negative), default is set to 50") nbtrials <- 50 } if (missing(typerunif) || !(typerunif %in% c("runifbase", "runifantithetics", "sobol", "torus", "niederreiterlodisp"))) { warning("typerunif is either missing or inadequate, and was set to default 'runifbase'") typerunif <- "runifbase" } else { typerunif <- match.arg(typerunif) } localsearch <- match.arg(localsearch) if (length(localsearch) == 0) localsearch <- "exhaustive" if (localsearch == "exhaustive") { start0 <- rUnif(nbtrials = nbtrials, nbpar = nbpar, lower = lower, upper = upper, method = typerunif) } if (localsearch == "median") { if (nbpar == 1) { U <- rUnif(nbtrials = nbtrials, nbpar = nbpar, lower = lower, upper = upper, method = typerunif) fwU <- objectivefn(U, ...) start0 <- U[fwU < median(fwU)] nbtrials <- length(start0) } else { U <- rUnif(nbtrials = nbtrials, nbpar = nbpar, lower = lower, upper = upper, method = typerunif) fwU <- apply(U, 1, function(x) objectivefn(x, ...)) start0 <- U[fwU < median(fwU), ] nbtrials <- dim(start0)[1] } } if (missing(hessian) && themethod %in% c("L-BFGS-B", "Nelder-Mead")) hessian <- FALSE packageStartupMessage("Processing...", appendLF = FALSE) cat("\n") return(call_localoptim(start0 = start0, objectivefn = objectivefn, gradient = gradient, ..., hessian = hessian, lower = lower, upper = upper, control = control, themethod = themethod, nbtrials = nbtrials, verb = verb, cl = nbclusters)) } } --- function search by body --- Function multiStartoptim in namespace mcGlobaloptim has this body. ----------- END OF FAILURE REPORT -------------- Fatal error: length > 1 in coercion to logical * checking PDF version of manual ... OK * checking for non-standard things in the check directory ... OK * checking for detritus in the temp directory ... OK * DONE Status: 1 ERROR, 2 NOTEs See ‘/data/gannet/ripley/R/packages/tests-LENGTH1/ycinterextra.Rcheck/00check.log’ for details. Command exited with non-zero status 1 Time 1:58.31, 37.28 + 6.24