|
if ("actions" %in% names(x$pre) && "recipe" %in% names(x$pre$actions)) { |
print.canned_epipred <- function(x, name, ...) {
[...]
if ("actions" %in% names(x$pre) && "recipe" %in% names(x$pre$actions)) {
Presumably, x$pre is supposed to be the preprocessor, but it actually partial-matches to x$predictions.
musing: if not for this coincidence, warnPartialMatchDollar wouldn't have even caught this and we'd just be testing vs. NULL. This is also an issue for epi_archives. (And also epi_dfs though for attrs not list elts.) Is there any sort of list subclass that makes $/attr do exact matches and produce an error rather than NULL when the requested key has no match?
epipredict/R/canned-epipred.R
Line 115 in 7f08d40
Presumably,
x$preis supposed to be the preprocessor, but it actually partial-matches tox$predictions.musing: if not for this coincidence,
warnPartialMatchDollarwouldn't have even caught this and we'd just be testing vs.NULL. This is also an issue forepi_archives. (And alsoepi_dfs though for attrs not list elts.) Is there any sort of list subclass that makes$/attrdo exact matches and produce an error rather thanNULLwhen the requested key has no match?