add_positions_nodes: Add positions to the nodes

Description Usage Arguments Value Author(s) References Examples

View source: R/add_positions_nodes.R

Description

Aggregate positions to the nodes into mclean output

Usage

1
add_positions_nodes(network, data, labels = "nodes", x = "x", y = "y")

Arguments

network

list; output from mclean function.

data

matrix or data frame with postitions to add into the network object.

labels

character string specifying the lables of each data element.

x

character string specifying the x position of each data element.

y

character string specifying the y position of each data element.

Value

It adds two new columns x and y in the node object.

Author(s)

Daniel Alcaide, daniel.alcaide@esat.kuleuven.be

References

Alcaide D, Aerts J. (2018) MCLEAN: Multilevel Clustering Exploration As Network. PeerJ Computer Science 4:e145 https://doi.org/10.7717/peerj-cs.145

Examples

1
2
3
4
5
6
7
8
data("synthetic_distances")
require(Rtsne)
tsne <- Rtsne(synthetic_distances, dims = 2, is_distance = TRUE, verbose=FALSE,
             perplexity = (nrow(as.matrix(synthetic_distances))/3)-1)
tsne_output = cbind(rownames(as.matrix(synthetic_distances)), as.data.frame(tsne$Y));
colnames(tsne_output) = c("V1", "V2", "V3")
output = mclean(distance_matrix = synthetic_distances, threshold = 187, method = "single")
plot_network( add_positions_nodes(output, tsne_output, labels = "V1", x = "V2", y = "V3")  )

danielalcaide/mclean documentation built on May 28, 2019, 7:51 p.m.