我有一个干净的 tibble,如下图所示:
df <- structure(list(created_week = c(31, 32, 33, 34), Rt_count = c(7,
6, 5, 0), Cus_count = c(2, 1, 2, 1)), class = c("tbl_df", "tbl",
"data.frame"), .Names = c("created_week", "Rt_count", "Cus_count"
), row.names = c(NA, -4L))
我正在寻找与基础的 t() 相同的操作,以 tibble 作为结果,并将 df$created_week 的行及其名称,列是 Rt_count 和 Cus_count 并且必须命名。我找不到简单易行的方法。
谢谢你的帮助。