R/landscape.make.genind.R

Defines functions landscape.make.genind

Documented in landscape.make.genind

#Create genind object from landscape
#ignores the haploid loci
landscape.make.genind <- function(Rland)
  {
      tab <- landscape.ind.freq(Rland)*2
      dimnames(tab) <- list(rownames=1:dim(tab)[1],colnames=landscape.freq.locnames(Rland))
      pl <- landscape.ploidy(Rland)
      populations <- landscape.populations(Rland)
      gi=genind(tab,pop=as.factor(populations),ploidy=2)
      gi[,loc=which(pl>1)]
  }

Try the rmetasim package in your browser

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

rmetasim documentation built on Feb. 8, 2020, 1:06 a.m.