Skip to content

Instantly share code, notes, and snippets.

@Martins6
Created August 5, 2020 16:52
Show Gist options
  • Save Martins6/8d821dab9945410bd86c02420775c16b to your computer and use it in GitHub Desktop.
Save Martins6/8d821dab9945410bd86c02420775c16b to your computer and use it in GitHub Desktop.
How to capture the output of the show_query. Modification of the answer from https://stackoverflow.com/questions/46002597/how-to-catch-a-dplyr-query-in-a-string.
# Capture
output <- capture.output(q1 %>% show_query())
# Concatenate character vector to a one length character vector
final_output <- paste(tail(output, -1), collapse=" ")
final_output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment