landscape.ind.freq: Return a matrix containing genotypes in 'frequency per...

View source: R/landscape.ind.freq.R

landscape.ind.freqR Documentation

Return a matrix containing genotypes in 'frequency per individual' format

Description

Converts a landscape into a format that can be used in creating genind objects

Usage

  landscape.ind.freq(Rland, include.states=TRUE)

Arguments

Rland

the Rmetasim landscape object

include.states

deprecated

Details

This function returns a frequency by individual matrix for the landscape given in Rland

Genotypes are stored in a landscape object as columns representing allelic position. If the locus is haploid, there is a single column and if diploid, two. The allele indices are entered in each column for individual genotypes.

The 'frequency per individual' format has a column for every locusXallele combination; genotypes are represented as the frequency of particular alleles in an individuals genotype (for example freq = 1 in a column diploid means that the individual is homozygous for that column, 0.5 in two columns represents a heterozygote for the alleles represented by those two columns). This is essentially the genind format from adegenet.

Value

matrix

See Also

landscape.freq.locnames, landscape.make.genind

Examples

  exampleland <- landscape.new.example() 
  exampleland <- landscape.simulate(exampleland, 25)
  head(landscape.ind.freq(exampleland))

stranda/rmetasim documentation built on Aug. 25, 2023, 12:22 p.m.