Skip to content

Register data frames? #522

Description

@ddsjoberg

We could include information on how that df was filtered. Anything else? How would this information then be passed and stored in the ARD?

Mock function that does not work :)

register_data <- function(data, 
                                 label, 
                                 filter, 
                                 data_name = rlang::caller_arg(data)) {
  

  if (!rlang::is_missing(filter)) {
    data <- data |> dplyr::filter({{ filter }})
  }
  filter_expr <- rlang::enexpr(filter)  

  attr(data, "ARD Data Name") <- data_name
  attr(data, "ARD label") <- label
  attr(data, "ARD filter expression") <- filter_expr
  
  class(data) <- c("card_registered", class(data))
  
  data
}

register_data(
  data = cards::ADSL, 
  label = "Safety Pop", 
  filter = SAFFL == "Y", 
  data_name = "ADSL"
)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions