vec2dist(x, size, labels = NULL, diag = FALSE, upper = FALSE,
call = FALSE, method = NULL)
is.dist(x)
## S3 method for class 'dist':
stack(x, dim.names = FALSE, ...)
dist
).dist
).TRUE
, names stored in the Labels
attribute of the
dist
object are returned as factors instead of row/column indices.vec2dist
returns an object of class dist
.
is.dist
returns a logical statement about the class of the object.
stack.dist
returns a data frame with comuns row
for row id's, col
for column
id's and dist
for the distance values.vec2dist(1:3, 3)
vec2dist(1:3, 3, diag = TRUE)
vec2dist(1:3, 3, diag = TRUE, upper = TRUE)
vec2dist(1:3, 3, labels=letters[1:3])
x <- dist(1:5)
attr(x, "Labels") <- LETTERS[1:5]
x
is.dist(x)
stack(x)
stack(x, dim.names = TRUE)
Run the code above in your browser using DataLab