YosefLab / scone

53 stars 12 forks source link

bug in scone_eval when batch is NULL #14

Closed drisso closed 8 years ago

drisso commented 8 years ago
if( !is.null(batch) | !any(!is.na(batch)) ){
  KNN_BATCH = mean(attributes(knn(train = proj[!is.na(batch),],test = proj[!is.na(batch),],cl = batch[!is.na(batch)], k = eval_knn,prob = TRUE))$prob)
}else{
  KNN_BATCH = NA
}

fails when batch=NULL because !any(!is.na(NULL)) is TRUE

drisso commented 8 years ago

BTW !any(!is.na(batch)) should be all(is.na(batch))

drisso commented 8 years ago

Fixed in develop