-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Came across an issue when trying to row bind projectable columns of the same class that were created with the helper around new_col()
along the lines of can't combine elements with different attributes. Fixed the issue by explicitly adding these helper functions where the new class was being defined.
# Helpers ----------------------------------------------------------------------
#' @export
#' @rdname col_median_ci
is_col_median_ci <- function(x) {
inherits(x, "projectable_col_median_ci")
}
#' @export
`names<-.projectable_col_median_ci` <- function(x, value) {
names(vctrs::field(x, "median")) <- value
x
}
#' @export
names.projectable_col_median_ci <- function(x) {
names(vctrs::field(x, "median"))
}
# Define coercion rules --------------------------------------------------------
# Self-coercion
#' @export
vec_ptype2.projectable_col_median_ci.projectable_col_median_ci <- function(x, y, ...) {
new_col_median_ci()
}
# Define comparison rules ------------------------------------------------------
#' @export
vec_proxy_compare.projectable_col_median_ci <- function(x, ...) {
vec_proxy_compare.projectable_col(x, ...)
}
I think only the coercion and comparison rules ones are required, but I haven't tested that.
Metadata
Metadata
Assignees
Labels
No labels