Skip to content

convenience function to remove pairs with missing values #44

Open

Description

@corybrunson

As proposed in this issue on ripserr, it may make sense to distinguish between persistent pairs with infinite values and those with missing values. The former might need to be handled in dependents like {plt} and {TDAvec} as they see fit, or else by the user; but i think it will be important for {phutil} to include a function to prune such pairs from persistence data, the reasons being that they are much less common and might be generated by one engine but not another and therefore obscured from a user's view.

This would be useful downstream, e.g. as the core of a {tdarec} step to remove pairs with missing values.

I haven't thoroughly explored the possibility space, but the most efficient method i found looks like this:

l <- lapply(l, function(m) m[! apply(is.na(m) | is.nan(m), 1L, any), , drop = FALSE])

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions