Skip to content

Register data frames? #522

@ddsjoberg

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"
)

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

Status

No status

Relationships

None yet

Development

No branches or pull requests

Issue actions