dist_mass_dataset | R Documentation |
dist_mass_dataset
dist_mass_dataset( x, margin = c("variable", "sample"), method = c("euclidean", "maximum", "manhattan", "canberra", "binary", "minkowski"), diag = FALSE, upper = FALSE, p = 2 )
x |
mass_dataset class |
margin |
sample or variable |
method |
the distance measure to be used. This must be one of "euclidean", "maximum", "manhattan", "canberra", "binary" or "minkowski". Any unambiguous substring can be given. |
diag |
logical value indicating whether the diagonal of the distance matrix should be printed by print.dist. |
upper |
logical value indicating whether the upper triangle of the distance matrix should be printed by print.dist. |
p |
The power of the Minkowski distance. |
dist returns an object of class "dist".
Xiaotao Shen shenxt1990@outlook.com
library(massdataset) library(magrittr) data("expression_data") data("sample_info") data("sample_info_note") data("variable_info") data("variable_info_note") object = create_mass_dataset( expression_data = expression_data, sample_info = sample_info, variable_info = variable_info, sample_info_note = sample_info_note, variable_info_note = variable_info_note ) object x = object %>% log(2) %>% scale() variable_distance <- dist_mass_dataset(x = x, margin = "variable") head(as.matrix(variable_distance)[, 1:5]) sample_distance <- dist_mass_dataset(x = x, margin = "sample") head(as.matrix(sample_distance)[, 1:5])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.