R code associated with preprint proposing flat persistence diagram for better visualization of persistent homology.