Learn R Programming

DEMEtics (version 0.8.1)

inputformat: Transformation of a Data Table Containing Allelic Data for Several Loci

Description

This function transforms the format of tables containing allelic data for several loci and populations. The transformed format is needed for all of the functions that are included in this package and handle with such data tables.

Usage

inputformat(filename, object)

Arguments

filename
Its syntax depends on the setting of the argument 'object'. If 'object=FALSE', the filename has to be a combination of (1) the name of the data file ('.txt format') in which the raw data are saved and (2) the extension '.txt'. It has to be enclos
object
This argument can be set as TRUE or FALSE, depending on the format (file or object) of the argument 'filename'.

Value

  • A data table is returned and saved as 'Output-Inputformat.txt' in the actual working directory. It contains the original data in another table format:

    cccc{ individual population fragment.length locus P1.1 P1 175 L1 P1.1 P1 183 L1 P1.2 P1 183 L1 P1.2 P1 183 L1 P2.1 P2 230 L1 P2.1 P2 225 L1 . . . . . . . . . . . . P1.1 P1 110 L2 P1.1 P1 110 L2 P1.2 P1 123 L2 P1.2 P1 126 L2 P2.1 P2 110 L2 P2.1 P2 110 L2 . . . . . . . . . . . . } The data in the column 'fragment.length' represent numbers of base pairs.

See Also

setwd, getwd, all.pops.D, all.pops.Dest, all.pops.Dest.Chao, all.pops.Gst, all.pops.Gst.est, pair.pops.D, pair.pops.Dest, pair.pops.Dest.Chao, pair.pops.Gst, pair.pops.Gst.est

Examples

Run this code
data(Example.untransformed)
Example <- Example.untransformed
inputformat("Example",object=TRUE)

# note that the transformed data table is saved under the filename
# Output-Inputformat.txt. If you don't know where it has been saved,
# type 'getwd()'.

transformed.table <- read.table("Output-Inputformat.txt",header=TRUE)

transformed.table

Run the code above in your browser using DataLab