cynthiahqy / conformr-xmap-project

R Package for harmonising data of different classifications or aggregations into a single dataset
MIT License
7 stars 1 forks source link

Clean up xmap classes #97

Closed cynthiahqy closed 1 year ago

cynthiahqy commented 1 year ago

Clean up the spaghetti code that implements the xmap_tbl class in preparation for an xmap_list class in #98

Will not implement:

cynthiahqy commented 1 year ago

:fire: for reference xmap_tbl subclass had too many classes:

#'
.get_xmap_subclass_attr <- function(subclass = c("xmap_df", "xmap_tbl")){
  subclass <- rlang::arg_match(subclass)

  class_attr <- switch(subclass,
         xmap_df = c("xmap_df", "xmap", "data.frame"),
         xmap_tbl = c("xmap_tbl", "xmap_df", "xmap", "tbl_df", "tbl", "data.frame"),
         stop("Unknown xmap subclass"))

  return(class_attr)
}