Converts valid objects to PHom instances.
as.PHom(x, dim_col = 1, birth_col = 2, death_col = 3)object being converted to PHom instance
either integer representing column index for feature
dimension data or character representing column name
either integer representing column index for feature
birth data or character representing column name
either integer representing column index for feature
death data or character representing column name
PHom instance
# construct data frame with valid persistence data
df <- data.frame(dimension = c(0, 0, 1, 1, 1, 2),
birth = rnorm(6),
death = rnorm(6, mean = 15))
# convert to `PHom` instance and print
df_phom <- as.PHom(df)
df_phom
#> PHom object containing persistence data for 6 features.
#>
#> Contains:
#> * 2 0-dim features
#> * 3 1-dim features
#> * 1 2-dim feature
#>
#> Radius/diameter: min = -1.863; max = 16.889.
# print feature details to confirm accuracy
print.data.frame(df_phom)
#> dimension birth death
#> 1 0 -1.86301149 15.36295
#> 2 0 -0.52201251 13.69546
#> 3 1 -0.05260191 15.73778
#> 4 1 0.54299634 16.88850
#> 5 1 -0.91407483 14.90255
#> 6 2 0.46815442 14.06415