rrrlw / TDAstats

R pipeline for computing persistent homology in topological data analysis. See https://doi.org/10.21105/joss.00860 for more details.
https://rrrlw.github.io/TDAstats
GNU General Public License v3.0
37 stars 8 forks source link

allow `calculate_homology` to return data frames #18

Closed rrrlw closed 3 years ago

rrrlw commented 4 years ago

Currently, TDAstats::calculate_homology only returns a matrix. When converted to a data frame with as.data.frame, users need to convert the dimension column to a factor (instead of numeric) to accurately plot colors in barcode (allow discrete colors instead of quantitative color spectrum). Easy fix would be to add parameter that returns a properly formatted data frame to users so that they don't have to do any extra steps.

rrrlw commented 3 years ago

Instead of just calculate_homology, will have all functions (e.g. including plot_* functions) work w/ data frames as default instead of numeric matrices

SPRADA1 commented 3 years ago

Hi! When I use calculate_homology over a graph with 7 vertices (for example) I only obtain 6 features at dimension 0 and that start with a filtration weight 0, why is that? Shouldn't be 7 features? I couldn't find the reason in your guidelines or vignettes. Thanks!

rrrlw commented 3 years ago

Hi @SPRADA1, this is a great question. Would you be willing to open a new issue in this repository with the same text above so that I can address it independently from the upcoming change with calculate_homology?

rrrlw commented 3 years ago

fixed in port to ripser (around 8e937b4)