Learn R Programming

LEA (version 1.4.0)

create.dataset: create a data set with masked data

Description

create.dataset creates a data set with a given percentage of masked data from the original data set. It is used to calculate the cross.entropy criterion.

Usage

create.dataset (input.file, output.file, seed = -1, percentage = 0.05)

Arguments

input.file
A character string containing a path to the input file, a genotypic matrix in the geno format.
output.file
A character string containing a path to the output file, a genotypic matrix in the geno format. The output file is the input file with masked genotypes. By default, the name of the output file is the same name as the input file with a _I.geno extension.
seed
A seed to initialize the random number generator. By default, the seed is randomly chosen.
percentage
A numeric value between 0 and 1 containing the percentage of masked genotypes.

Value

output.file
A character string containing a path to the output file, a genotypic matrix in the geno format.

Details

This is an internal function, automatically called by snmf with the entropy option.

See Also

geno snmf cross.entropy

Examples

Run this code
# Creation of tuto.geno
# A file containing 400 SNPs for 50 individuals.
data("tutorial")
write.geno(tutorial.R,"genotypes.geno")

# Creation      of the masked data file
# Create file:  "genotypes_I.geno"
output = create.dataset("genotypes.geno")

Run the code above in your browser using DataLab