5

I'm relatively new to R, so hopefully this is an easy fix.

Here's my problem:

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 

How can I get the column names to align left with the rest of the dataframe?

Thanks in advance.

smci
  • 32,567
  • 20
  • 113
  • 146
neuropsych
  • 61
  • 1
  • 4

1 Answers1

5
# print object explicitly
print(x,right=F)
Petr Matousu
  • 3,120
  • 1
  • 20
  • 32