【发布时间】:2021-12-13 12:02:05
【问题描述】:
我有一个数据框
a = c("A","B","C")
b = c(12,13,14)
c = ("Great","OK","Bad")
df = data.frame(a,b,c)
我想打印出每一行的所有列 预期输出:
A is 12 mins and it is Great
B is 13 mins and it is OK
C is 14 mins and it is Bad
我尝试使用cat 或paste0,但它并不能如我所愿。
【问题讨论】:
-
请提供您尝试过的 cat 和 paste 的代码。
-
试试:
with(df, paste(a, "is", b, "mins and it is", c))