landscape.locus: return a matrix containing genotypes for a particular locus

Description Usage Arguments Details Value See Also Examples

View source: R/loci.R

Description

return a matrix containing genotypes for a particular locus

Usage

1
  landscape.locus(Rland, lnum=1, do.check=F)

Arguments

lnum

the locus to return

Rland

the Rmetasim landscape object

do.check

flag to call 'is.landscape' on input

Details

Returns a matrix with rows = dim(rland$individuals)[1]. The first three columns correspond to the class (and two placeholder variables) of an individual. Here rland is a landscape object. The remaining columns (1 if haploid, 2 if diploid) contain the allele indices for the various loci

Value

matrix

See Also

landscape.populations

Examples

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

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