as.data.frame.dist {ProcMod}R Documentation

Converts a dist object to a data.frame object.

Description

The created data.frame has a attribute is.dist set to the logical value TRUE.

Usage

## S3 method for class 'dist'
as.data.frame(x, row.names = NULL, optional = FALSE, ...)

Arguments

x

the dist object to be converted

row.names

NULL or a character vector giving the row names for the data frame. Missing values are not allowed.

optional

logical. If TRUE, setting row names and converting column names (to syntactic names: see make.names) is optional. Note that all of R's base package as.data.frame() methods use optional only for column names treatment, basically with the meaning of data.frame(*, check.names = !optional). See also the make.names argument of the matrix method.

...

additional arguments to be passed to or from methods.

Author(s)

Eric Coissac

Christelle Gonindard-Melodelima

Examples

data(bacteria)
bacteria_rel_freq <- sweep(bacteria,
                           1,
                           rowSums(bacteria),
                           "/")
bacteria_hellinger <- sqrt(bacteria_rel_freq)
bacteria_dist <- dist(bacteria_hellinger)
bdf <- as.data.frame(bacteria_dist)


[Package ProcMod version 1.0.8 Index]