R/geno2lfmm.R

Defines functions geno2lfmm

Documented in geno2lfmm

geno2lfmm <- function(    input.file, output.file = NULL,
            force = TRUE) 
{
    # test arguments and init
    # input file
        if(missing(input.file)) 
        stop("'input.file' argument is missing.")
    else if (!is.character(input.file))
        stop("'input.file' argument has to be of type character.")
    # check the extension
    test_extension(input.file, "geno");
    # output file    
    if (!missing(output.file) && !is.character(output.file))
        stop("'output.file' argument has to be of type character.")
        else if (missing(output.file))
        output.file = setExtension(input.file, ".lfmm")
        # skip
        if (!force && file.exists(input.file) && file.exists(output.file)) {
#        print(cat("'", output.file, "' already exists!", sep=""))
                return(output.file)
    }

    N = 0;M = 0;
    # run method
    .C("R_geno2lfmm", 
    as.character(input.file),
    as.character(output.file),
    as.integer(N),
    as.integer(M)
    );

    # create output 
    output.file;
}

Try the LEA package in your browser

Any scripts or data that you put into this service are public.

LEA documentation built on Nov. 8, 2020, 8:19 p.m.