nMarkers {pedtools} | R Documentation |
The number of markers attached to a pedigree
Description
The number of markers attached to a pedigree
Usage
nMarkers(x, compwise = FALSE)
hasMarkers(x, compwise = FALSE)
Arguments
x |
A |
compwise |
A logical, only relevant if |
Value
nMarkers()
by default returns a single number; the number of marker
objects attached to x
. If x
is a ped list, an error is raised if the
components have different numbers of markers. This check can be skipped by
setting compwise = TRUE
, in which case the function returns a vector of
the component-wise marker numbers.
The function hasMarkers(x)
returns TRUE if (at least component of) x
has attached markers, otherwise FALSE. If compwise = TRUE
, a logical
vector of the same length as x
.
Examples
x = nuclearPed() |> addMarker()
nMarkers(x) # = 1
y = list(x, singleton(1))
nMarkers(y, compwise = TRUE) # c(1,0)
hasMarkers(y) # TRUE
hasMarkers(y, compwise = TRUE) # c(TRUE, FALSE)
[Package pedtools version 2.7.0 Index]