You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe the issue stems from the first lines of the .add_reference_level() function. Here we have
.add_reference_level <- function(params) {
# check if we have a model object, else return parameter table
model <- .get_object(params)
if (is.null(model)) {
params
}
...
}
and if we look at .get_object() we can see that NULL is returned if the model object doesn't have an object_name attribute which it won't have if it's part of a pipe.
.get_object <- function(x, attribute_name = "object_name") {
obj_name <- attr(x, attribute_name, exact = TRUE)
model <- NULL
if (!is.null(obj_name)) {
model <- .safe(get(obj_name, envir = parent.frame()))
# prevent self reference
if (is.null(model) || inherits(model, "parameters_model")) {
model <- .safe(get(obj_name, envir = globalenv()))
}
}
model
}
The text was updated successfully, but these errors were encountered:
I guess pipe-workflow will also fail in other situations, maybe we can in general improve stability when we rely on the call if no object name is available.
The following example shows that the
include_reference = TRUE
option ofprint()
doesn't work with pipes.I believe the issue stems from the first lines of the
.add_reference_level()
function. Here we haveand if we look at
.get_object()
we can see thatNULL
is returned if the model object doesn't have anobject_name
attribute which it won't have if it's part of a pipe.The text was updated successfully, but these errors were encountered: