knitr::opts_chunk$set(echo = TRUE) set.seed(42)
# install.packages("remotes") remotes::install_github("hsonne/findblobs")
findblobs::plot_integer_matrix(matrix(nrow = 5, byrow = TRUE, c( 2, 2, 2, 2, 2, 2, 0, 1, 0, 2, 2, 1, 1, 1, 2, 2, 0, 1, 0, 2, 2, 2, 2, 2, 2 )))
random_blobs <- findblobs::place_random_blobs( n_blobs = 5, min_fields = 3, max_fields = 10 )
# Provide matrix of logical M <- random_blobs > 0 # Find the blobs found_blobs <- findblobs:::get_blobs(M) # Plot the blobs. Compare with random_blobs above findblobs::plot_integer_matrix(found_blobs)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.