R/delNULLpop.R

Defines functions delNULLpop

delNULLpop <- function(Populations){


 npops        <- length(Populations)
 PPopulations <- list()
 popmissing   <- NULL

 yy <- 1
 for(xx in 1:npops){
   if(length(Populations[[xx]])>0){
   PPopulations[[yy]] <- Populations[[xx]]
   yy <- yy + 1
   }else{
   popmissing <- c(popmissing,xx)
   }
 }

 Populations <- PPopulations
 if(length(popmissing)==0){
   popmissing <- integer(0)
 }
 
return(list(Populations=Populations,popmissing=popmissing))
}

Try the PopGenome package in your browser

Any scripts or data that you put into this service are public.

PopGenome documentation built on Feb. 1, 2020, 1:07 a.m.