R/remove_empty_elements.R

Defines functions remove_empty_elements

remove_empty_elements <- function(peaklist){
    is_empty <- unlist(lapply(peaklist, function(x){length(x)==0}))
    if(sum(is_empty)>0) {
        message("Removing ",sum(is_empty)," empty elements in peaklist")
        peaklist <- peaklist[!is_empty] 
    } 
    return(peaklist)
}
serachoi1230/EpiCompare documentation built on Jan. 30, 2024, 11:37 a.m.