is.PHom: Check PHom Object

View source: R/PHom.R

is.PHomR Documentation

Check PHom Object

Description

Tests if objects are valid PHom instances.

Usage

is.PHom(x)

Arguments

x

object whose PHom-ness is being tested

Value

TRUE if x is a valid PHom object; FALSE otherwise

Examples

# create sample persistence data
df <- data.frame(dimension = c(0, 0, 1, 1, 1, 2),
                 birth = rnorm(6),
                 death = rnorm(6, mean = 15))
df <- as.PHom(df)

# confirm that persistence data is valid
is.PHom(df)

# mess up df object (feature birth cannot be after death)
df$birth[1] <- rnorm(1, mean = 50)

# confirm that persistence data is NOT valid
is.PHom(df)

rrrlw/ripserr documentation built on July 12, 2022, 11:13 a.m.