rownames-methods {haplotypes}R Documentation

Retrieve or set the row names

Description

Function to get or set row names of a sequence matrix in a Dna object or distance matrix (or matrices) in a Parsimnet object.

Usage

## S4 method for signature 'Dna'
rownames(x)
## S4 method for signature 'Parsimnet'
rownames(x)
## S4 replacement method for signature 'Dna'
rownames(x)<-value
## S4 replacement method for signature 'Parsimnet'
rownames(x)<-value

Arguments

x

an object of class Dna or Parsimnet.

value

a character vector of the same length as number of sequences or a list of the same length as number of networks including vertex names for each network. See ‘Examples’

Methods

signature(x = "Dna")
signature(x = "Parsimnet")

Examples


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

### Method for signature 'Dna'.

## Getting sequence names.
rownames(x)

## Setting sequence names.
rownames(x)<-c(1:nrow(x))
rownames(x)

### Method for signature 'Parsimnet'.
x<-dna.obj

##single network
p<-parsimnet(x)

##Getting vertex names
rownames(p)

## Setting vertex names.
rownames(p)<-list(c(1:nrow(p@d[[1]])))
rownames(p)
plot(p)

## Multiple networks with 99% connection limit.
p<-parsimnet(x,prob=.99) 

## Getting vertex names
rownames(p)

## Setting vertex names.
rownames(p)<-list(1:9, 10, 11,12:13,14,15:16)
rownames(p)




[Package haplotypes version 1.1.3.1 Index]