Troubles with 'NULL' in paste

Hi! I am having some troubles with the application of glue with some columns that have NULL in it.
Let me present this reprex:

df <- tibble(
  a = c(1,2,3,4),
  b = c('NULL','x','y','z')
)

a.1 <- colnames(df)
b.1 <- paste(paste0("'{",a.1,"}'"),collapse = ',')
  
df %>% 
  mutate(c = glue('(',b.1,')')) %>% 
  select(c)

This code gives this result:

('1','NULL')
('2','x')
('3','y')

However, I am wondering if is there a way to obtain something like

('1',NULL)
('2','x')
('3','y')

This will allow me to transfer my results to SQL. For that, I have tried to use conditionals inside glue, like ifelse without results.
Please, any comment will be highly appreciated.
Regards

This topic was automatically closed 21 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.