Learn R Programming

haplotypes (version 1.1.3.1)

ncol-methods: Returns the length of the longest DNA sequence

Description

ncol returns the number of columns present in a matrix.

Usage

# S4 method for Dna
ncol(x)

Value

an integer of length one.

Arguments

x

an object of class Dna.

Methods

signature(x = "Dna")

ncol returns the number of columns present in the sequence matrix (length of the longest DNA sequence).

See Also

length-methods

Examples

Run this code
data("dna.obj")
x <-dna.obj

## Giving the length of the longest sequence.
ncol(x) 
# gives the same result
length(x) 

Run the code above in your browser using DataLab