用
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
本文标题:将数据框的每一行/列合并成一个字符串
本文链接:https://www.haomeiwen.com/subject/fumpoctx.html
网友评论