stamppConvert: Import and Convert

Description Usage Arguments Value Author(s) Examples

View source: R/stamppConvert.R

Description

Imports biallelic AB formated or allele A frequency genotype data. If the data is in imported in biallelic AB format this function also converts it to allele frequencies

Usage

1
stamppConvert(genotype.file, type = "csv")

Arguments

genotype.file

the genotype input file. This should be a R matrix object or a file path for a csv file containing the genotype data in either bialleleic AB format or allele 'A' frequency format, or a genlight object containing genotype data

type

the type of file the genotype data is being imported from; "csv" = comma seperated file, "r" = data frame in the R workspace, "genlight" = genlight object.

Value

An object of class data.frame which contains allele frequency data for use in other StAMPP functions

Author(s)

Luke Pembleton <luke.pembleton at agriculture.vic.gov.au>

Examples

1
2
3
4
# Import example data into the R workspace
data(potato.mini, package="StAMPP")
# Convert to allele frequencies
potato.freq <- stamppConvert(potato.mini, "r")

Example output

Loading required package: pegas
Loading required package: ape
Loading required package: adegenet
Loading required package: ade4
Registered S3 method overwritten by 'spdep':
  method   from
  plot.mst ape 

   /// adegenet 2.1.3 is loaded ////////////

   > overview: '?adegenet'
   > tutorials/doc/questions: 'adegenetWeb()' 
   > bug reports/feature requests: adegenetIssues()


Registered S3 method overwritten by 'pegas':
  method      from
  print.amova ade4

Attaching package:pegasThe following object is masked frompackage:ade4:

    amova

The following object is masked frompackage:ape:

    mst

StAMPP documentation built on Aug. 8, 2021, 9:07 a.m.