landscape.states: return a matrix containing actual genotypes for a particular...

View source: R/loci.R

landscape.statesR Documentation

return a matrix containing actual genotypes for a particular locus

Description

return a matrix containing the states of the alleles in genotypes for a particular locus

Usage

  landscape.states(Rland,lnum=1)

Arguments

lnum

the locus to return

Rland

the Rmetasim landscape object

Details

Returns a matrix with rows = dim(rland$individuals)[1]. The columns 1:landscape.democol() correspond to demographic variables for an individual. The columns are: state, placeholder, birthyear, id, mother's id, and father's id. Here rland is a landscape object. The remaining columns (1 if haploid, 2 if diploid) contain the states of the alleles for the selected loci

Value

matrix

See Also

landscape.locus

Examples

  exampleland <- landscape.new.example()
  exampleland <- landscape.simulate(exampleland, 4)
  print("Allele frequencies at locus 1")
  table(landscape.states(exampleland,1)[,c(-1:-landscape.democol())]) 
  rm(exampleland)

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