nsam: Return the number of samples.

nsamR Documentation

Return the number of samples.

Description

This function returns the number of samples recorded in the GDS file connected to the given GbsrGenotypeData object.

Usage

nsam(object, valid = TRUE, ...)

## S4 method for signature 'GbsrGenotypeData'
nsam(object, valid)

Arguments

object

A GbsrGenotypeData object.

valid

A logical value. See details.

...

Unused.

Details

If valid = TRUE, the number of the samples which are labeled TRUE in the "valid" column of the "sample" slot will be returned. If you need the number of over all samples, set valid = FALSE. validSam() tells you which samples are valid.

Value

An integer value to indicate the number of samples.

See Also

validSam()

Examples

# Load data in the GDS file and instantiate a [GbsrGenotypeData] object.
gds_fn <- system.file("extdata", "sample.gds", package = "GBScleanR")
gds <- loadGDS(gds_fn)

nsam(gds)

# Close the connection to the GDS file.
closeGDS(gds)


tomoyukif/GBScleanR documentation built on April 27, 2024, 9:06 a.m.