我对R来说比较新,所以希望这是一个简单的解决方案。
这是我的问题:
x <- data.frame(c("Thing1", "Thing2", "Thing3", "Thing4", "Thing5"), c("Sizeable line of text", "more text", "I hope this aligns", "something", "help me"))
colnames(x) <- c("T", "Text")
format(x, justify = "left")
T Text
1 Thing1 Sizeable line of text
2 Thing2 more text
3 Thing3 I hope this aligns
4 Thing4 not much
5 Thing5 help me
如何让列名与数据帧的其余部分左对齐?
提前致谢。
答案 0 :(得分:2)
# print object explicitly
print(x,right=F)