Learn R Programming

haplotypes (version 1.1.3.1)

as.data.frame-methods: Coerces a Dna object to a data.frame

Description

Coerces an object to a data.frame.

Usage

# S4 method for Dna
as.data.frame(x)

Value

returns a data frame.

Arguments

x

an object of class Dna.

Methods

signature(x = "Dna")

coerces a Dna object to a data.frame.

Examples

Run this code

data("dna.obj")

x<-dna.obj
x<-as.dna(x[1:4,1:6])

## Coercing a 'Dna' object to a data.frame.
df<-as.data.frame(x)
df

# TRUE
is.data.frame(df) 

if (FALSE) {
# gives the same result 
df<-as.data.frame(x@sequence) 
df
}

Run the code above in your browser using DataLab