Running examples in ‘HotDeckImputation-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: impute.NN_HD
> ### Title: The Nearest Neighbor Hot Deck Algorithms
> ### Aliases: impute.NN_HD
> ### Keywords: NA manip optimize multivariate
> 
> ### ** Examples
> 
> #Set the random seed to an arbitrary number
> set.seed(421)
> 
> #Generate random integer matrix size 10x4
> Y<-matrix(sample(x=1:100,size=10*4),nrow=10)
> 
> #remove 5 values, ensuring one complete covariate and 5 donors
> Y[-c(1:5),-1][sample(1:15,size=5)]<-NA
> 
> #Impute using various different (arbitrarily chosen) settings
> impute.NN_HD(DATA=Y,distance="man",weights="var")
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
HotDeckImputation
 --- call from context --- 
impute.NN_HD(DATA = Y, distance = "man", weights = "var")
 --- call from argument --- 
if (class(DATA) == "data.frame") {
    DATA <- .DATA_recode(DATA)
    recoded <- TRUE
    weights <- .create.weightsvector(DATA = original_data, weights = weights)
    weights <- weights[DATA$weightsindex]
    DATA <- DATA$DATA_recode
} else {
    DATA <- data.matrix(DATA)
    weights <- .create.weightsvector(DATA = DATA, weights = weights)
    recoded <- FALSE
}
 --- R stacktrace ---
where 1: impute.NN_HD(DATA = Y, distance = "man", weights = "var")

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (DATA = NULL, distance = "man", weights = "range", attributes = "sim", 
    comp = "rw_dist", donor_limit = Inf, optimal_donor = "no", 
    list_donors_recipients = NULL, diagnose = NULL) 
{
    arguements <- list(distance = distance, weights = weights, 
        attributes = attributes, comp = comp, donor_limit = donor_limit, 
        optimal_donor = optimal_donor, list_donors_recipients = list_donors_recipients, 
        diagnose = diagnose)
    original_data <- DATA
    if (class(DATA) == "data.frame") {
        DATA <- .DATA_recode(DATA)
        recoded <- TRUE
        weights <- .create.weightsvector(DATA = original_data, 
            weights = weights)
        weights <- weights[DATA$weightsindex]
        DATA <- DATA$DATA_recode
    }
    else {
        DATA <- data.matrix(DATA)
        weights <- .create.weightsvector(DATA = DATA, weights = weights)
        recoded <- FALSE
    }
    n <- dim(DATA)[1]
    m <- dim(DATA)[2]
    if (attributes == "sim") {
        if (is.null(list_donors_recipients)) {
            list_donors_recipients <- .create.dr_list(DATA = DATA, 
                attributes = attributes)
        }
        if (!is.matrix(distance)) {
            distance <- .calculate.distancematrix(DATA = DATA, 
                distance = distance, weights = weights, comp = comp, 
                list_donors_recipients)
        }
        donor_limit <- .create.donorlimit(donor_limit = donor_limit, 
            list_donors_recipients = list_donors_recipients)
        list_recip_donor <- .match.donor_recipient(list_donors_recipients = list_donors_recipients, 
            distance = distance, optimal_donor = optimal_donor, 
            donor_limit = donor_limit)
        envir <- as.environment(".GlobalEnv")
        .dump_diagnostics(diagnose = diagnose, diagnostics = list(arguements = arguements, 
            distances = distance, list_donors_recipients = list_recip_donor), 
            envir = envir)
        DATA <- .impute(DATA = original_data, list_recip_donor = list_recip_donor, 
            recoded = recoded)
    }
    else {
        stop("Unimplemented way of handling attributes used: \"seq \"")
    }
    return(DATA)
}
<bytecode: 0x55b6b9d07df8>
<environment: namespace:HotDeckImputation>
 --- function search by body ---
Function impute.NN_HD in namespace HotDeckImputation has this body.
 ----------- END OF FAILURE REPORT -------------- 
Error in if (class(DATA) == "data.frame") { : 
  the condition has length > 1
Calls: impute.NN_HD
Execution halted