as.data.frame.dist: Converts a 'dist' object to a 'data.frame' object.

Description Usage Arguments Author(s) Examples

View source: R/multivariate.R

Description

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

Usage

1
2
## 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

1
2
3
4
5
6
7
8
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)

ProcMod documentation built on May 12, 2021, 9:08 a.m.