length-methods: Methods for function 'length' in the package 'haplotypes'

length-methodsR Documentation

Methods for function length in the package haplotypes

Description

Methods for function length.

Usage

## S4 method for signature 'Dna'
length(x)
## S4 method for signature 'Haplotype'
length(x)
## S4 method for signature 'Parsimnet'
length(x)

Arguments

x

an object of class Dna, Haplotype or Parsimnet.

Value

returns a non-negative integer vector.

Methods

signature(x = "Dna")

returns the longest sequence length.

signature(x = "Haplotype")

returns the number of haplotypes.

signature(x = "Parsimnet")

returns the length of network(s).

See Also

ncol-methods

Examples

data("dna.obj")
x<-dna.obj

## Longest sequence length
length(x)


## Total number of haplotypes
h<-haplotype(x)
length(h)

## Length of network(s)
p<-parsimnet(x,prob=.95)
# length of the network
length(p)
 
p<-parsimnet(x,prob=.99)
# length of the networks
length(p)


haplotypes documentation built on July 26, 2023, 5:22 p.m.