seems to work
my_info <- function(x){
obj_name <- deparse(substitute(x))
cli::cli_alert_info("Access column names with {obj_name}$<var>")
cli::cli_alert_info("e.g., {obj_name}${names(x)[1]}")
}
my_print <- function(x){
obj_name <- deparse(substitute(x))
cli::cli_h1("My Object")
cli::cli_text("My dims are {dim(x)}")
eval(parse(text=cli:::glue("my_info({obj_name})")))
}
my_info(airquality)
my_print(airquality)