predict.references_best <- function(object, ...){ . <- N <- expr.name <- NULL ## Above for CRAN NOTEs. L <- list(...) if(length(L)==0){ L <- list(seconds=object[["seconds.limit"]]) } if(is.null(names(L)) || any(names(L)=="")){ stop("... has an un-named argument, but must have a unit as the name of each argument") } name.tab <- table(names(L)) too.many <- name.tab[1 < name.tab] if(length(too.many)){ info.vec <- sprintf("%s(%d)", names(too.many), too.many) info.str <- paste(info.vec, collapse=", ") stop("argument names should be unique, problem(count): ", info.str) } object$prediction <- data.table(unit=names(L))[, { unit.value <- L[[unit]] if(!is.numeric(unit.value)){ stop("... has a non-numeric argument (", unit, "), but each argument must be numeric (unit value at which to interpolate/predict N)") } if(length(unit.value) != 1){ stop("... has an argument with length != 1 (", unit, "), but each argument must be scalar (unit value at which to interpolate/predict N)") } if(!is.finite(unit.value)){ stop("... has a non-finite argument (", unit, ") but each argument must be finite (unit value at which to interpolate/predict N)") } is.unit <- object$measurements$unit == unit meas <- object$measurements[is.unit & 0