is.genalex: Check to see if an object is of class genalex

Description Usage Arguments Details Value Author(s) Examples

Description

Check to see if an object is of class genalex as recognised by the readGenalex package. With force = TRUE, the internal consistency of the data and annotations are checked.

Usage

1
2
is.genalex(x, force = FALSE, skip.strings = FALSE, skip.extra = FALSE,
  verbose = FALSE)

Arguments

x

An object that might be of class genalex

force

If TRUE and x has class genalex, force a deeper check to assure that the data and annotations are consistent with class genalex

skip.strings

If TRUE and force = TRUE, do not check the attributes "dataset.title" and "data.file.name" for consistency.

skip.extra

If TRUE and force = TRUE, do not check the extra data columns (attribute "extra.columns" for consistency.

verbose

If TRUE and force = TRUE, indicate any inconsistencies discovered between the data and annotations. if there are no inconsistencies, nothing is printed.

Details

Two attributes that may commonly be found to differ from inferred values are "dataset.title" and "data.file.name", if there have been manipulations to the class. These attributes cannot be removed from a valid object of class genalex, but they can be set to the empty string ("") to avoid this check. Alternatively, the option skip.strings = TRUE may be set to not check these specific attributes for consistency. Extra data columns are checked first for existence, then for contents, then for matching row names. The option skip.extra = TRUE may be set to not check extra data columns.

Value

TRUE or FALSE

Author(s)

Douglas G. Scofield

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data(Qagr_adult_genotypes)
is.genalex(Qagr_adult_genotypes)

## create an inconsistent attribute
attr(Qagr_adult_genotypes, "n.loci") <- 20

## this doesn't detect the inconsistency
is.genalex(Qagr_adult_genotypes)

## this detects the inconsistency, returns FALSE
is.genalex(Qagr_adult_genotypes, force = TRUE)
is.genalex(Qagr_adult_genotypes, force = TRUE, verbose = TRUE)

douglasgscofield/readGenalex documentation built on May 15, 2019, 10:43 a.m.