powered by
Construct a binary adjacency matrix
build_knn_graph(coords, k)
An n x 2 data frame or matrix of 2d spot coordinates
The number of neighbors
an adjacency matrix
# NOT RUN { data(coords_df_sim) coords_df <- coords_df_sim[,1:2] A <- build_knn_graph(coords_df,k = 4) # }
Run the code above in your browser using DataLab