R output to txt file
问题 I have a data frame in 2 columns userID itemID 1 101 1 103 1 107 2 102 2 103 3 104 ... The output I want is to write a file to result.txt 1 \t 101 , 103 , 107 2 \t 102 , 103 3 \t 104 here \t means a tab distance between userID and the itemID. This is not as aligned as a table. I am more of Java and Python background, what are the lower level writing commands in R for general purpose? 回答1: you can use dplyr package for this library(dplyr) df.summary <- df %.% group_by(userId) %.% summarise