Open chackoemily opened 1 day ago
Thank you @chackoemily for pointing this out!
This behavior is intentional, but i agree that it's suboptimal. These functions require lists (of PLs) as input, so they just don't know how to handle non-list objects.
I've pushed a hopeful fix to the list
branch, which adds a check-step to each such function as follows:
pl_function <- function(pl_list, ...) {
# if not a list, wrap in a list and recurse
if (! is.list(pl_list)) return(pl_function(list(pl_list)))
# handle a list
<original code>
}
Please try installing from that branch and let me know if the problem persists. Note that this branch is also updated with pl_new()
having replaced landscape()
. This should do the installation:
remotes::install_github("corybrunson/plt", ref = "list")
When calculating the mean persistence landscape with pl_mean(), an error is thrown if there is only one persistence landscape in the 'pl_list' argument. The error states, "Error in as.environment(new("refMethodDef", .Data = function (...) : invalid object for 'as.environment' "
Code to reproduce error:
I expected that pl_mean() would either handle a single persistence landscape without error and return the landscape itself as the mean or provide a more informative message that explains why computing the mean is not possible with a single landscape.