Print a data frame with columns aligned (as displayed in R)
问题 I have the following data frame in R: > dframe Mean Median Candidates 85.68 60 NonCands 9.21 4 Multi 27.48 17 Mono 4.43 3 Multi NonCands 22.23 15 I want to print it into a file and keep it nicely formatted and aligned just as shown above. I use: write.table(dframe,file="test",sep="\t", quote=F) which produces the following output: Mean Median Candidates 85.68 60 NonCands 9.21 4 Multi 27.48 17 Mono 4.43 3 Multi NonCands 22.23 15 Since the data is displayed properly formatted within the R