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)
}
neurogenomics/EpiCompare documentation built on Oct. 18, 2024, 11:04 p.m.