as.data.frame.dist | R Documentation |
dist
object to a data.frame
object.The created data.frame
has a attribute is.dist
set to
the logical value TRUE
.
## S3 method for class 'dist' as.data.frame(x, row.names = NULL, optional = FALSE, ...)
x |
the |
row.names |
NULL or a |
optional |
logical. If |
... |
additional arguments to be passed to or from methods. |
Eric Coissac
Christelle Gonindard-Melodelima
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)