Learn R Programming

ripserr (version 0.3.0)

is.PHom: Check PHom Object

Description

Tests if objects are valid PHom instances.

Usage

is.PHom(x)

Value

TRUE if x is a valid PHom object; FALSE otherwise

Arguments

x

object whose PHom-ness is being tested

Examples

Run this code
# 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)

Run the code above in your browser using DataLab