Is this specifically for dataframe? Is this close to what you have in mind?
library(magrittr)
# simulate copy a dput output
clipr::write_clip(
'
structure(list(
mean = c(NA, NA, 1.62, 1.48, 1.43, 1.55, 1.60, 1.63, 1.48, 1.43, 1.43, 1.41, NA),
lower = c(NA, NA, 1.23, 0.95, 1.04, 1.15, 1.01, 1.83, 1.15, 1.04, 1.07, 0.79, NA),
upper = c(NA, NA, 2.14, 2.31, 1.95, 2.09, 2.53, 5.68, 1.91, 1.95, 1.92, 2.54, NA)),
.Names = c("mean", "lower", "upper"),
row.names = c(NA, -13L),
class = "data.frame")
'
)
# write as tribble call
clipr::read_clip() %>%
parse(text = .) %>%
eval() %>%
datapasta::tribble_paste()
#> tibble::tribble(
#> ~mean, ~lower, ~upper,
#> NA, NA, NA,
#> NA, NA, NA,
#> 1.62, 1.23, 2.14,
#> 1.48, 0.95, 2.31,
#> 1.43, 1.04, 1.95,
#> 1.55, 1.15, 2.09,
#> 1.6, 1.01, 2.53,
#> 1.63, 1.83, 5.68,
#> 1.48, 1.15, 1.91,
#> 1.43, 1.04, 1.95,
#> 1.43, 1.07, 1.92,
#> 1.41, 0.79, 2.54,
#> NA, NA, NA
#> )
# write as a data.frame call
clipr::read_clip() %>%
parse(text = .) %>%
eval() %>%
datapasta::df_paste()
#> data.frame(
#> mean = c(NA, NA, 1.62, 1.48, 1.43, 1.55, 1.6, 1.63, 1.48, 1.43, 1.43,
#> 1.41, NA),
#> lower = c(NA, NA, 1.23, 0.95, 1.04, 1.15, 1.01, 1.83, 1.15, 1.04, 1.07,
#> 0.79, NA),
#> upper = c(NA, NA, 2.14, 2.31, 1.95, 2.09, 2.53, 5.68, 1.91, 1.95, 1.92,
#> 2.54, NA)
#> )
Created on 2018-10-10 by the reprex package (v0.2.1)
In either case, I don't think row names are preserved and list columns seems partially supported in tribble_paste. If this is the right direction and you feel strongly about either feature, you may contribute back to the datapasta package.