# Form two different "views" of the same data
iris30 <- iris[c(1:10, 51:60, 101:110), ]
iris_sg12 = similarity_graph(iris30[, 1:2], n_neighbors = 5)
iris_sg34 = similarity_graph(iris30[, 3:4], n_neighbors = 5)
# Combine the two representations into one
iris_combined <- simplicial_set_intersect(iris_sg12, iris_sg34)
# Optimize the layout based on the combined view
iris_combined_umap <- optimize_graph_layout(iris_combined, n_epochs = 100)
Run the code above in your browser using DataLab