Learn R Programming

haplotypes (version 1.1.3.1)

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

Description

Methods for function length.

Usage

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

Value

returns a non-negative integer vector.

Arguments

x

an object of class Dna, Haplotype or Parsimnet.

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

Run this code
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)

Run the code above in your browser using DataLab