giver text message with output vars

I have some output from the code below and now i want to add some text with with output like . please check the columns ("region","name","col1","col8" ,"date") from database

library(tidyverse)
# Define the cols variable
cols <- readr::cols(
  region = col_character(),
  name = col_character(),
  col1 = col_character(),
  col2 = col_double(),
  col3 = col_integer(),
  col4 = col_double(),
  col5 = col_double(),
  col6 = col_integer(),
  col7 = col_double(),
  col8 = col_character(),
  date = col_character()
)

enframe(cols$cols) |> 
  rowwise() |> 
  filter(identical(value,
                   col_character())) |> 
  ungroup() |>  select(name) |> tibble::deframe()

the output should look like

please check the columns ("region","name","col1","col8" ,"date") from database

If you put the result in a variable col_names, you can use:

col_names_collapsed <- paste0('"',col_names, '"', collapse = ", ")
message("Please check ", col_names_collapsed, " from db")

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.