This function calls dump on one or several R objects, which creates code that recreates them from the console. It then copies this code to the clipboard. This can be used to quickly copy (small) objects between R sessions, for instance during package development and testing, or - of course - to paste the dump code into a forum post.
dump_to_clip(x)
if (interactive()) {
outcome <- "mpg"
mod <- lm(mpg ~ wt, mtcars)
mod %>% dump_to_clip() # will be named dumped_object
dump_to_clip(c("outcome", "mod")) # will retain variable names
}