Closed cynthiahqy closed 1 year ago
validate_as_xmap()
#' Validation Helper for `xmap` objects
#'
#' @param x A candidate object (i.e. data frame) to be validated
#'
#' @return `x` if validation passes. Throws error otherwise.
#'
#' @section Methods:
#' \Sexpr[stage=render,results=rd]{generics:::methods_rd("xmap_validate")}
#'
#' @export
#'
validate_as_xmap <- function(x) {
UseMethod("validate_as_xmap")
}
This would allow the crossmap approach to be integrated into existing data preprocessing pipelines
validate_xmap_df()
to skip or use lightweight check with redirection to validate_links_as_xmap()
as_xmap_df()
to use validate_links_as_xmap()
and new_xmap_df()
--- something to reduce check redundancies?
TODO
verify_links_as_xmap()
To simplify error handling,
validate_xmap_df()
internal function (i.e. swapdf_check()
for lightweight boolean checks, and if any fail, direct user to usevalidate_as_xmap()
validate_as_xmap()
generic in the style ofas_xmap()
It doesn't really make sense to have
xmap_validate()
functions since the xmap have to be validated before becoming an xmap; and if you made it some other way, then it still makes sense that you want tovalidate_as_xmap()
. The most likely workflow is:not
It could make sense though to have validation for special types #88 e.g.:
with additional types:
xmap_validate_as_agg()
xmap_validate_as_disagg()