用
apply()
。
# 1行2列,用空格分开
apply(df, 1, paste, collapse=" ")
from In R: Joining vector elements by row, converting vector rows to strings - Stack Overflow
用
apply()
。
# 1行2列,用空格分开
apply(df, 1, paste, collapse=" ")
from In R: Joining vector elements by row, converting vector rows to strings - Stack Overflow